Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 12th, 2007, 09:51 AM
Registered User
 
Join Date: Dec 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default loading an image dynamically into my report

Please,

I have report already design, whose dataset is an object in my program. one of my variable is of type System.Drawing.Image. I want to be able to load this image into my report.

Note: All other fields are displaying; it is just my image field

 
Old January 4th, 2008, 09:35 AM
Authorized User
 
Join Date: Dec 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pannasn
Default

Hi,

In the dataset designer page, create a table e.g., Images.
Then try the following in the reportviewer form:

Image oLogo;
MemoryStream msX = new MemoryStream();
if (File.Exists(image path))
  {
   oLogo = Image.FromFile(image path);
   oLogo.Save(msX, System.Drawing.Imaging.ImageFormat.Bmp);
  }

DataRow dr;
dr = DataSet.Images.NewRow();
dr[0] = msX.GetBuffer();
DataSet.Images.Rows.Add(dr);
DataSet.WriteXmlSchema(msX);

Then open database-expert from the report. You will see that the Image table is shown. Include it in your datasource.

In the report, open field explorer and you will find a BLOB field in the Image table.

Drag and drop it into the report.

I hope it will help you.


Thanks & Regards
Panna
Digital Horizons
India





Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading Image to Image Control using JavaScript ctranjith General .NET 1 May 28th, 2013 05:43 AM
displaying image as logo dynamically in report asad_uet Crystal Reports 0 June 26th, 2006 03:57 AM
Loading forms dynamically bmains C# 2005 1 November 30th, 2005 03:53 PM
dynamically loading table using javascript bkalyanchakri Javascript How-To 1 November 1st, 2005 07:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.