SAP Knowledge Base Article - Public

1320507 - How to dynamically change an image, based on the parameter value selected for the report in Crystal Reports?

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"
             
    1. In Crystal Reports, open a report.
        
    2. Create a parameter, and set a List of Values that will correspond to the image to display on the report.
        
    3. Insert a static picture on the report, where you want the picture to display.
        
    4. Right click on the picture, and select "Format Graphic"
          
    5. In the "Format Editor" under the tab "Picture", click on the "X-2" button for the option: "Graphic Location"
       
        
         Graphic Location.png
            
           
    6. 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"
             
    7. Click on Save and Close.
           
    8. Back to the "Format Editor", click "OK" to accept the change.

Keywords

dynamic , KBA , BI-RA-CR , Crystal Reports designer or BusinessViews Manager , Problem

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016