How to include an Image in a Report

How Can We Help?

How to include an Image in a Report

< Back

Background

Let’s say you have an XMPro Activity or Task where you have included the Upload Control to upload image files or take photos and upload them from your mobile. Once the activity is completed, you might want to include the captured image in the activity into an XMPro Report.

Pre-requisites

XMDesigner, Report Generation and custom scripting knowledge is required to generate the report with the image uploaded.

To Include an image in a report, the following pre-requisites need to be completed.

Develop a XMPro process with two steps

 

  1. A mobile enabled first activity form where you have configured Upload Control. On clicking submit, the next activity ‘Print Report’ will be initiated.
  2. Second activity (Print Report) which will be initiated from a command control of the first activity. The Second activity controls are as follows.

We want to generate a report by clicking on Generate Report. We want the report to contain the image captured and uploaded in the first activity.

Develop a XMPro Report Template

Develop a XMPro report template using XMPro Report Designer. Include a Picture Box in the report and Include a Parameter field called ‘Photo1 to accept input from the ‘Print Report’ form.

Including an Image in a Report

Report Changes

Log into XMDesigner. Launch Report Designer and open the report already created as per the prerequisites. Click on the Picture Box and change the Sizing to Squeeze.

Save the Report and click on the Scripts.

In the opened script editor, select the Picture Box Control and Select Before Print.

Paste the following code on to the script editor and save the report.

Make sure the pictureBox id and Photo parameter name are modified according to the names in your report.

 

‘Print Report’ activity Changes

Navigate to ‘Print Report’ and click on Managed activity.

 

Add the following references in the opened script editor. The DevExpress version depends on the XMPro Product Version. Refer to your “bin” directory in XMPro Installation Directory to know the Dev Express Version.

Close the Script Editor and Save the activity. Double Click on ‘Print Report’ activity. Enable Script IDE and double click on ‘Generate Report’ command control to open script designer.

Let’s say if the command control id is “SE3050GenerateReport”, in the opened script designer, paste the following lines of code and replace the place holders as required.

The report will be generated in the folder mentioned as per the name provided in the code.

Comments are closed.

This is the legacy version of the XMPro Documentation site. For the latest XMPro documentation, please visit documentation.xmpro.com

X