Home > SI5 Documentation > User Guide > Reports > Designer > Customization Examples > Adding a Dynamic Image to the Cover Page

Adding a Dynamic Image to the Cover Page

Adding a "Dynamic" Image to the Cover Page

 

All of the stock SI5 Proposal reports have a cover page. We have had requests from clients for the ability to have an image of their client’s house print on the cover page for each project. This method assumes that you are willing to pick a specific location and file name for the image file and that you will update this file for each project as this path and filename are going to be hardcoded into the report, i.e. – you will be using this same file name and path for every project.
 
Tip: once done running your reports for a project, to keep a copy of the image for each project by using the Add a File to This Project function.
 
  1. Create a folder somewhere on your machine. In this example the folder is on the C: drive and is named “_D-Tools CP Image”.

File:Si5Wiki/SI5/10Reports/05Designer/xCustomization_Examples/Adding_a_Dynamic_Image_to_the_Cover_Page/folderpath.jpg

  1. Place whatever image you want to print on the cover page within this folder and give it a specific name. In this example, I will put a picture of the client’s house in the folder and name it CPImage.jpg.

File:Si5Wiki/SI5/10Reports/05Designer/xCustomization_Examples/Adding_a_Dynamic_Image_to_the_Cover_Page/CPImage.jpg

  1. Open the Report Designer (Tools->Report Designer->Standard Reports) and choose to create a “New Report Based on Existing Report:

File:Si5Wiki/SI5/10Reports/05Designer/xCustomization_Examples/Adding_a_Dynamic_Image_to_the_Cover_Page/nrw1.jpg

  1. Select the report where you want to base yours off of and click Next. In this example I am using the Proposal With Images report.
  2. Name your report on the next step then click Next through all the rest of the steps of this wizard until you get to the last step, then click Finish.
  3. On the canvas, drag a Picture control from the Toolbox over to the ReportHeader1 section (where the fields for the Cover Page are). Resize the box as desired.

PictureControl.jpg

  1. With the Picture control selected on the canvas, in the Properties window give the object a name and change the SizeMode field to “Zoom”:

File:Si5Wiki/SI5/10Reports/05Designer/xCustomization_Examples/Adding_a_Dynamic_Image_to_the_Cover_Page/PropertiesName.jpg

  1. Click the Script tab along the bottom of the report designer:

File:Si5Wiki/SI5/10Reports/05Designer/xCustomization_Examples/Adding_a_Dynamic_Image_to_the_Cover_Page/scripttab.jpg

  1. In the “ReportHeader1_Format” section, add the following line of code, substituting the name of your Picture control and path to your file.

 

ReportUtilities.SetImage(rpt,"ReportHeader1","picCP","C:\_D-Tools CP Image\CPImage.jpg")

File:Si5Wiki/SI5/10Reports/05Designer/xCustomization_Examples/Adding_a_Dynamic_Image_to_the_Cover_Page/addedscript.jpg

  1. Click the Designer tab along the bottom of the report designer:

File:Si5Wiki/SI5/10Reports/05Designer/xCustomization_Examples/Adding_a_Dynamic_Image_to_the_Cover_Page/DesignerTab.jpg

  1. Click the [Publish Report] button:

File:Si5Wiki/SI5/10Reports/05Designer/xCustomization_Examples/Adding_a_Dynamic_Image_to_the_Cover_Page/publishreportbutton.jpg

  1. Run your report and verify that your image displays on the cover sheet of the proposal:

FinishedReport.jpg

  1. To test that this is dynamic, replace the image in the folder with another image, just make sure you name the file the same as above:

SecondRun.jpg

Last modified
15:46, 26 Nov 2013

Tags

This page has no custom tags.

Classifications

This page has no classifications.