Symptom
- How to change the picture dynamically?
- How to display a different logon on the report based on the parameter value selected?
- How to dynamically change the picture on a report based on the prompt value selected in Crystal Reports?
Environment
- SAP Crystal Reports 2008
- SAP Crystal Reports 2011
- SAP Crystal Reports 2013
- SAP Crystal Reports 2016
Resolution
- To dynamically change an image on a report based on a parameter value selected, use the formatting option "Graphic Location"
- In Crystal Reports, open a report.
- Create a parameter, and set a List of Values that will correspond to the image to display on the report.
- Insert a static picture on the report, where you want the picture to display.
- Right click on the picture, and select "Format Graphic"
- In the "Format Editor" under the tab "Picture", click on the "X-2" button for the option: "Graphic Location"
- In the "Formula Editor", enter the path to the desired picture, based on the parameter value selected. The formula will look like:
If {?Country Parameter} = "USA" Then
"C:\MyDocuments\MyPictures\USA.bmp"
Else If {?Country Parameter} = "India" Then
"C:\MyDocuments\MyPictures\India.bmp"
- Click on Save and Close.
- Back to the "Format Editor", click "OK" to accept the change.
Keywords
dynamic , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem
Product
Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016