Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using the crystal report version 13.0 in visual studio 2015 to display image in the report header.

What I have tried:

I did the following steps

1. Inserted an OLE Object by right clicking in the report
2. Browsed a picture from the create from file option
3. Created a String Parameter in the report and named it as PicPath.
3. After placing the OLE Object, right click on the object and in the Picture tab in on the Graphic Location and in the Formula editor button drag and drop the parameter into the formula section and saved the report.


In the C# coding

string path = "../Reports/image.png"
CrystalDecisions.CrystalReports.Engine.ReportClass crpc= new CrystalDecisions.CrystalReports.Engine.ReportClass();
crpc.SetParameterValue("PicPath",path);

But the report is not displaying in the report.

The same i have tried after inserting the Picture instead of OLE object.
But the image is not showing.
Posted
Updated 25-Jan-19 1:43am

1 solution

Don't use a relative path, since you do not know at run time what it will be relative to. Put your image in some fixed location (e.g AppData/Local, ProgramData etc.) and use the absolute path in your report parameters.
 
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