Insert image in Crystal Reports At Runtime

Posted on 2010-08-12
Medium Priority
Last Modified: 2013-12-27
Ok I am trying to bring a image out of my database and associate it with each product line item.

Ive read the example at  http://www.codeproject.com/KB/vb/Image_in_Crystal_Reports.aspx

but that didnt seem to help, any ideas? thanks

Sales.Logic.SalesOrderCollection orders = new Sales.Logic.SalesOrderCollection();
                SalesOrderReport report = new SalesOrderReport();
                DataTable dt = new DataTable();
                dt = orders.GetOrderItems(ID).Tables[0];
                dt.Columns.Add("Image", System.Type.GetType("System.Byte[]"));

                for (int i = 0; i < dt.Rows.Count; i++)
                    Product.Logic.ProductMediaCollection medias = new Product.Logic.ProductMediaCollection();

                    if(medias.Count > 0)
                        dt.Rows[i]["Image"] = (byte[])medias[0].Media;


                crystalReportViewer.ReportSource = report;

Open in new window

Question by:Poolcorp
LVL 11

Accepted Solution

mattibutt earned 2000 total points
ID: 33425126

Author Comment

ID: 33431071
No luck im afraid the same results. I am storing the image file in my sql server database as a "image" data type, could that have anything to do with it?

Expert Comment

ID: 33998755
trying storing it in bytes...

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Ready to kick start your career in 2018? Add app developer skills to your resume. January’s Course of the Month features Android App Development training with hands-on learning.  Read on to learn why these skills are important.
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
Through the video, you can check the migration process of Outlook PST file to PDF. Kernel for Outlook to PDF tool can convert Outlook emails with all attributes like Subject, To, From, Cc, Bcc and other folders such as Inbox, Outbox, Sent Items, Jun…
Suggested Courses

587 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question