Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Insert image in Crystal Reports At Runtime

Posted on 2010-08-12
3
Medium Priority
?
378 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 2000 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Integration Management Part 2
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month21 days, 3 hours left to enroll

810 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