How to Display Dynamic Images in Crystal Report
Code for displaying Dynamic Images in Crystal Report With Out Using Database. Images Changes According to the condition we can able to change the images. label of the added picture should be unique in the crystal report.........
How to use Dynamic images in Crystal Report with out Using Database
step 1: Add Pictures in Crystal report and Suppress all the pictures
For example:
let us Consider 5 pictures A,B,C,D,E. Add those Pictures using Insert Picture Property After Adding just supress the all 5 Pictures.
Step 2:
In Your Asp.net Page Just check the the condition according to that remove Suppress option
Code:
using crystalDecisions.Shared;
using crystalDecisions.crystalReports.Engine;
ReportDocument crDoc=new ReportDocument();
crDoc.load(crystalreportpath,OpenReportMethod.OpenReportByTempCopy);
if(id=="A")
{
crDoc.ReportDefinition.Sections("SectionNameinCrystalReport").ReportOject("PicturelabelName").ObjectFormat.EnableSuppress=False
}
else if(id=="B")
{
crDoc.ReportDefinition.Sections("SectionNameinCrystalReport").ReportOject("PicturelabelName").ObjectFormat.EnableSuppress=False
}
else if(id=="C")
{
crDoc.ReportDefinition.Sections("SectionNameinCrystalReport").ReportOject("PicturelabelName").ObjectFormat.EnableSuppress=False
}
else if(id=="D")
{
crDoc.ReportDefinition.Sections("SectionNameinCrystalReport").ReportOject("PicturelabelName").ObjectFormat.EnableSuppress=False
}
else if(id=="E")
{
crDoc.ReportDefinition.Sections("SectionNameinCrystalReport").ReportOject("PicturelabelName").ObjectFormat.EnableSuppress=False
}