Add a Data Set
A data set fetches data from the Trimble Unity database tables to display data in a report. The DataSet panel is where you provide a command type and query string and choose other options for your data set. Common Values can also be used and are generic report fields that can be added to a report.
NOTE: If multiple data sets are adding, the report reads them read top to bottom.
- Open the Report Designer.
- Click the Data tab.
- 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 a query to gather the desired fields from the desired database tables.
TIP: To add an entire table to a report, enter the following in the Query field: Select * from <table>. See Common Query Examples and Add a Dataset in the Mescius documentation for more a more in-depth explanation of data sets and crafting queries.
These are the fields that are used to create reports.
If a custom data source was added to pull in GIS thumbnails or attachments, 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.
- GIS Thumbnails
- thumbnail:workorder*
- This query fetches all work order related map images.
- thumbnail:workorder[WorkOrderId]<image file name>.png
- This query fetches a specific image from the work order ID entered when the report is viewed.
- thumbnail:case*
- This query fetches all case related map images.
- thumbnail:case[CaseObjectId]<image file name>.png
- This query fetches a specific image from the case 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.
To see the full process of configuring attachments for a report, see Configure Attachments for ActiveReports for more information.
- Click Validate.
- Click OK.
BEST PRACTICE: It is best to include only the necessary fields in the query to reduce the load on the application calls to the SQL Server instance. This approach ensures that the application logic iterates through fewer fields, optimizing performance.
The fields appear in the Data Sets panel on the right side. Now these fields can be dragged and dropped in to a report.
If a data source hasn't been added, a connection to the Trimble Unity database is automatically added in the Data Sources section.