Configure Attachments for ActiveReports
To bring in attachments, start by adding a data source, then create a query to retrieve the attachments you want, and finally ensure the report is configured correctly.
|
|
First, a custom data source must be added that allows access to attachments or GIS thumbnails that can be added to reports.
- Open the Report Designer.
- Click the Data tab and click Add.
- Enter the Name of the data source.
The Provider is set to Shared Reference.
- Select Trimble Unity Resources as the Reference.
- Click Add.
After a custom data source is added, a data set should be added with a query pointing to where the wanted attachments are.
- Click Add in the Data Sets section.
- Double-click the DefaultDataSet.
It appears under the Data Sets section.
- Click Edit Data Set.
- Edit the Name of the data set. Data set names cannot have spaces, but underscores or camel case can be used.
- Select Command Type. The default is Text.
- Enter something similar in the Query field to connect to the files wanted:
TIP: Use an asterisk (*) in a query at the end to pull in all attachments in a folder. If all attachments for an activity are configured to be added to a report, even those attachments which have been added and then removed from the work activity appear on the report.
- GIS Thumbnails
- thumbnail:workorder*
- This query fetches all work order related map images for the work order ID entered when the report is viewed.
- thumbnail:case*
- This query fetches all case related map images for the case ID entered when the report is viewed.
- thumbnail:inspection*
- This query fetches all inspection related map images for the inspection ID entered when the report is viewed.
- thumbnail:request*
- This query fetches all request related map images for the service request ID entered when the report is viewed.
- Attachments
- attachment:workorder/[WorkOrderID]/*
- This query fetches all attachments related to the work order ID entered when the report is viewed.
- attachment:Inspection/[InspectionId]/*
- This query fetches all attachments related to the inspection ID entered when the report is viewed.
- attachment:Request/[RequestId]/*
- This query fetches all attachments related to the service request ID entered when the report is viewed.
- attachment:reldocs/[CA_OBJECT_ID]/*
- This query fetches all attachments related to the case ID entered when the report is viewed.
- attachment:reldocs/[CA_OBJECT_ID]/payments/*
- This query fetches all payment attachments related to the case ID entered when the report is viewed.
- attachment:reldocs/[CA_OBJECT_ID]/tasks/*
- This query fetches all task attachments related to the case ID entered when the report is viewed.
IMPORTANT: A parameter must be configured if you are entering the ID of a specific work activity when viewing the report. See Create a Parameter for more information.
TIP: Instead of using a parameter and entering an ID, you could enter the specific ID number in the query to pull all attachments from that specific work activity. Additionally, instead of using the asterisk (*), you could enter the specific image file name wanted.
IMPORTANT: If you add an image control and render the stream content in it outside of a table or in a container, only the first image in the series renders. No images render in a banded list.
- Drag Table in the report from the AR Web Designer toolbar and remove all the tables and columns so it leaves one cell.
- Expand the cell.
- Drag Image into the report from the AR Web Designer toolbar and select the image box.
- On the right-side under the Appearance section, and click Expand next to the Image field.
- Select Database from the Source drop-down list.
- Enter {Stream} in the Value field.
- Select image/png from the MIME Type drop-down list.
- Select Fit from the Image Sizing drop-down list.
- Drag the image control into the table.