Click here to Skip to main content
15,901,284 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HY Everybody,
Dear programmers iam going to display an image on crystal report from C# Form on Button Click.The image path should be Selected from the Current Project.
i have display it with database but i cannot display it from the images present in my current project path.
Please any body help me.
Posted
Comments
ZurdoDev 7-May-12 19:43pm    
Reason for my vote of 1
What exactly is the question?

Hi,
If you are using datatable or dataset as datasource for crystal reports, then its very easy.
Just read the images into a stream. add the stream as a column in your data table. set the table as datasource. thats it.

C#
//Just for an information I'm just typing this code
//Correct the syntactical errors
DataTable tbl;
MemoryStream ms;

//your data table filling logic
tbl.Columns.add("ImageColumn",typeof(string));//Fine tune this
ms = //load your image into stream
tbl.rows(0).setitem //to set the image data
//set this tbl as datasource for your report
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900