Report Designer: Difference between revisions
→Grid: rewritten for clarify |
No edit summary |
||
| Line 173: | Line 173: | ||
* On a questionnaire, a report can be configured using the '''Mobile Report''' button in the [[Questionnaire_Designer#Actions_group|Questionnaire Designer]], or using [[Questionnaire_Designer#Configuring_commands|Commands]]. Users can launch the report for completed questionnaires. It is also possible to configure an automatic generation of reports on completion, or allow users to manually run a preliminary report for an in-progress questionnaire. | * On a questionnaire, a report can be configured using the '''Mobile Report''' button in the [[Questionnaire_Designer#Actions_group|Questionnaire Designer]], or using [[Questionnaire_Designer#Configuring_commands|Commands]]. Users can launch the report for completed questionnaires. It is also possible to configure an automatic generation of reports on completion, or allow users to manually run a preliminary report for an in-progress questionnaire. | ||
[[Category:Resco | [[Category:Resco Cloud]] | ||
Revision as of 11:06, 22 January 2020
Report Designer is a tool available to CRM administrators that allows you to design custom document templates. The template is then saved in your CRM as a record and it can be used across all mobile projects in your organization.
If you don't want to use the designer, you can create or edit the report templates directly as XML files.
Mobile reports
Reports are read-only visual representations of entity data. Users of the mobile app can use the templates to create reports on the go, using data from CRM. Reports are generated directly in the Mobile CRM application, even in offline mode, so there is no need for any connection to the internet or CRM server. This allows you to create e.g. an invoice or a service report at the customer and save it to a CRM record as an attachment. Or instantly email it to your customers and partners. Or use a wireless printer to directly print it.
Documents can be generated in Word (.docx), Excel (.xlsx), PDF, or HTML formats. It is also possible to use one or more records as a source for the report.
Mobile reports support many popular building blocks, such as
- Header and footer sections that repeat on all pages of the document
- Repeating blocks for recurring items (such as invoiced products)
- Any field from your entities
- Images, both static (for example your company logo) and dynamic (for example a signature)
- Dynamic reports involving business logic, for example, calculations, show or hide sections under specific conditions, etc.
See also the followings blogs: Blog
- Quick overview: Mobile reports in Resco Mobile CRM
- Anatomy of a Mobile Report
- Tailoring the mobile report: How to use custom and barcode fonts
Accessing the designer
Report Designer can be started from the management console of your CRM:
- Using a web browser, log in to your CRM.
- Launch the designer:
- For Resco CRM server, log in to your organization and select Reports.
- For Dynamics, go to the Settings of your CRM and select MobileCRM > Inspections. Then select Designer.
- For Salesforce, log in to Resco for Salesforce and select Mobile Report Editor.
In the case of Resco Inspections, you can start the Report Designer directly from the Questionnaire Designer: Click Mobile Report while editing a template; this button takes you directly to the report for this questionnaire.
Using the designer
On start, the Report Designer shows a list of existing reports. Use the toolbar in the top part of the screen to access most functions.
- New
- Create a new report. Specify a name, select an entity, the language, and decide if you want a report for a single record, for multiple records, or a combination.
- Edit
- Select an existing report and open it for editing.
- Properties
- Select a report and modify its properties.
- Delete
- Delete selected report.
- Activate
- Active reports are available in the app.
- Deactivate
- Inactive reports are not available in the app.
- Import
- Upload an XML file with a report.
- Export
- Download a copy of the select report template to your computer as a file in XML format.
- Clone
- Create a duplicate of the selected report template.
You can use the Search field above the toolbar to filter your reports. To sort the reports, click the header row of the report list.
Editing a report template
A new report contains a header block, a footer block, and a grid block.
- Use the toolbar buttons to add or remove grids, cells, columns, repeating blocks, and images / signature.
- Left pane displays a list of fields of the selected entity. Drag fields to the report.
- Use the right pane to modify the properties of selected items.
Once you've done editing a report, save changes and remember to activate it to make it available in the app.
Data and queries
Mobile reports contain either text or image data. This data can be static or loaded from the CRM database.
The primary variable for each report is either a single CRM record or a collection of CRM records. You have to decide whether the report is singular when designing the report.
You can also add input variables to the report. These are additional details the user has to fill out before executing a report, for example a range in dates or currency.
Use Fetch and Fetch-Table variables in order to load a record (or records) related to the primary variable. Fetch variable uses standard FetchXml to define the data-filter. Other variables can be also used in place of filter condition values. In case you want to load aggregated and/or group records instead of a record list, you can use the Aggregate function on the Fetch variable.
Variables can define a single primitive value, text, date, or number. However, the primary variable and a fetch variable are composite and contain multiple fields. To address a particular field of a complex variable, we use the . syntax.
Utilizing pre-defined variables you can also effortlessly incorporate several basic details into your mobile reports.
- The PageNumber variable (Page: {PageNumber}) specifies the sequence order of each page.
- The PageCount defines the total number of pages that the report contains.
- The CurrentDate variable ({CurrentDate:DDDD}) enables you to add the date and exact time when the mobile report was generated.
For example in the footer (or elsewhere on the page) you could include {PageNumber}/{PageCount}, dynamically changing depending on the page the user is viewing at that moment.
Structure
Mobile Reports are a collection of a few elements:
- TextBlock and ImageBlock define the data to display.
- The Grid element is used to arrange the blocks.
- The Repeater element allows iterating over a collection of CRM records (contained in the primary variable or fetch variables).
TextBlock
The purpose of the TextBlock element is to display textual data.
The block size and position are set through the Column, Row, ColumnSpan and RowSpan properties. The parent Grid of the block determines the actual pixel size of the block (assigning width and height to its columns and rows).
Each block has an attached Style, which controls how the text is drawn. It specifies the colors to use, the font name, border color and alignment, and other parameters – see #Edit styles below.
TextBlock displays constant text, which is just a drawn verbatim using the style information. To display dynamic data you must assign a variable binding to the TextBlock. This binding can be the name of a primitive (input) variable, such as dateRange. It can also be the name of a composite (primary, fetch) variable and a particular field, for example: order.totalamount.
In order to display multiple variables in a single field, wrap their names in curly brackets: {order.street1}, {order.city}, {order.country}. Any text outside of brackets will be copied verbatim (as a constant).
If you need to format a numeric or date value in a certain way, add a colon and a formatting string after the variable name: {order.createdon:YYYY-MM-DD}. Please see the C# Visual Studio reference for the possible formats. Last but not least, you can optionally include also the culture identifier to format dates or numbers for a specific culture. This controls the names of months, separators, etc.: {order.createdon:YYYY-MM-DD;en-US}. Examples:
- To convert the decimal variable to currency, use this C# format in the binding field – {variableName:C}.
- To convert datetime variable to date variable, use this C# format in the binding field – {variableName:MMMM d yyyy}.
ImageBlock
The purpose of the ImageBlock is to display JPEG or PNG images.
Its size and position follow the same rule as the TextBlock.
Static images are loaded from the Offline HTML section. You need to specify the image path: /folder/name.png or /folder/name.jpg.
Dynamic images are loaded from note attachment or cloud documents. To select an image, you simply define a fetch filter for the note entity. Remember that you can use also other variables in place of filter condition values.
Grid
Grid is the basic container element of a mobile report. It contains blocks of text and/or images arranged into a table pattern.
Click Add Grid to place a new grid. Grids can be added to the top level of your report, or into a Repeater element. New grids are added at the end of their parent element, use the buttons Up and Down to move them around.
Each grid starts with a single empty cell. Select the grid and click Add Column and Add Row to increase the number of columns and rows of your grid.
Column width
The maximum width of the grid is equal to the width of the page. You can specify the width of each column on the Properties pane in the Columns parameter, either a fixed width (in pixels) or flexible width (using stars notation). Separate values for each column with a semicolon.
If the grid contains at least one column with flexible width, the width of the grid is set to the page width. To calculate the width of flexible columns, we subtract all fixed-width columns from the page width and distribute the remainder evenly. To increase the width of a flexible column, add a number before the star; a 2* column is twice as wide as a 1* column.
In the example above, the first column is 100 pixels wide, and the remaining space is divided to column 2 and column 3, with column 3 being twice as wide as column 2.
Row height
The height of each row is specified in the Rows parameter on the Properties pane. Use Auto for automatic height calculation, or enter an explicit pixel size. Separate values for each row with a semicolon.
The automatic calculation uses the maximal height of the blocks in the grid row. That means either the height of text in a particular font or the height of an image (the image height might be scaled automatically to fit into a particular width).
In the example above, the first row is exactly 100 pixels tall, the remaining two rows use flexible height to match their content.
Repeater
Thanks to the Repeater element, you can display a list of multiple records in your reports. The element consists of an optional header Grid element and a body. If the repeater spans multiple pages, the header will be repeated on each page. The body of the repeater may contain a single or multiple Grid elements. You can also nest one or several Repeater elements into the report.
The repeater inherits all variables defined for the report.
It also contains one special iteration fetch variable. The repeater body is rendered for every record from this query.
Visibility
You can control the visibility of a TextBlock, ImageBlock and Grid, by setting the visibility property. The value used must be a valid variable in curly braces, e.g. {customer.primarycontactid}. The block or grid will not be visible only if the variable is false, zero (0) or null (empty). If you need the opposite behavior, use the exclamation mark before the variable: !{customer.primarycontactid}.
Editing styles
Click Edit Styles while editing a report template to customize cell styles. Unlike styles in Woodford where the styles are shared across an entire app project, styles in the Report Designer are unique per report.
See Style editor for more information.
Edit sources
Click Edit Sources to TBD.
Running the reports
You can run the reports in the app, in various components:
- On a form, a report can be configured via Form commands. Users can access the report using the hamburger menu in the top right corner of the form.
- On a view, a report can be configured using the Multi Select function. Users can select multiple records and then select the action from the bottom right corner.
- On a questionnaire, a report can be configured using the Mobile Report button in the Questionnaire Designer, or using Commands. Users can launch the report for completed questionnaires. It is also possible to configure an automatic generation of reports on completion, or allow users to manually run a preliminary report for an in-progress questionnaire.