Solved

Insert image in Crystal Reports At Runtime

Posted on 2010-08-12
3
361 Views
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();

                    medias.LoadByProductID(int.Parse(dt.Rows[i]["ProductID"].ToString()));



                    if(medias.Count > 0)

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



                }



                report.SetDataSource(dt);

                crystalReportViewer.ReportSource = report;

Open in new window

0
Comment
Question by:Poolcorp
3 Comments
 
LVL 11

Accepted Solution

by:
mattibutt earned 500 total points
ID: 33425126
0
 
LVL 3

Author Comment

by:Poolcorp
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?
0
 
LVL 3

Expert Comment

by:farwa
ID: 33998755
trying storing it in bytes...
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator (https://www.appcelerator.com/). This article presumes a wor…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now