?
Solved

Insert image in Crystal Reports At Runtime

Posted on 2010-08-12
3
Medium Priority
?
370 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month12 days, 4 hours left to enroll

752 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