Jump to content

Mobile reports for Resco Inspections: Difference between revisions

From Resco's Wiki
Line 34: Line 34:
* To switch between pre-defined report themes, click  '''Report Themes''' in the toolbar and select one of the themes. Selecting a new theme discards all changes in custom styles.
* To switch between pre-defined report themes, click  '''Report Themes''' in the toolbar and select one of the themes. Selecting a new theme discards all changes in custom styles.


=== Repeating blocks ===
=== Group properties ===
 
One of the big shortcomings of the generic report is how question groups are displayed. Therefore, the report customization in the Questionnaire Designer offers multiple options for displaying groups. To configure these, select a question group and modify parameters in the '''Reporting''' section on the '''Properties''' pane.
 
[[File:Reporting properties in the questionnaire designer.png]]
 
The first two parameters, '''Show Header''' and '''Header Style''', allow you to select if and how should the group header be displayed in the report.
 
The '''Questions Layout''' determines how the questions should be arranged:
* Horizontal: questions are arranged next to each other in a row
* Vertical: questions are arranged one below the other in a column
 
{| class="wikitable" style="width: 600px;"
|+ Horizontal layout
|-
| Question 1 Answer 1 ||  Question 2 Answer 2 ||  Question 3 Answer 3
|}
 
{| class="wikitable"
|+ Vertical layout
|-
| Question 1  Answer 1
|-
| Question 2  Answer 2
|-
| Question 3  Answer 3
|}
 
In the '''Break After''', specify how many questions should be listed in a single column or row before continuing to the next column or row. Note the different numbering order.
 
{| class="wikitable" style="width: 600px;"
|+ Horizontal layout, Break After = 3
|-
| Question 1 Answer 1 ||  Question 2 Answer 2 ||  Question 3 Answer 3
|-
| Question 4 Answer 4 ||  Question 5 Answer 5 ||
|}
 
{| class="wikitable" style="width: 600px;"
|+ Vertical layout, Break After = 3
|-
| Question 1 Answer 1 || Question 4 Answer 4
|-
| Question 2 Answer 2 ||  Question 5 Answer 5
|-
| Question 3 Answer 3 ||
|}
 
'''Border Kind''' and '''Line Color''' determine if and how table cell borders should be drawn. The following options are supported:
* Grid
* Rows
* Columns
* Outside Border
* No Border
 
For repeatable groups, you can additionally configure the '''Repeat Layout'''.
 
* Default – each instance of a repeating group is rendered as a separate group with its own header
* Compact – all instances of a repeatable group share a single header
 
{| class="wikitable" style="width: 600px;"
! colspan="3" | Default horizontal
|-
| Question 1 Answer 1 ||  Question 2 Answer 2 ||  Question 3 Answer 3
|-
| colspan="3" |   
|-
! colspan="3" | Default horizontal
|-
| Question 1 Answer 1 ||  Question 2 Answer 2 ||  Question 3 Answer 3
|-
| colspan="3" |   
|-
! colspan="3" | Default horizontal
|-
| Question 1 Answer 1 ||  Question 2 Answer 2 ||  Question 3 Answer 3
|}
 
{| class="wikitable" style="width: 600px;"
! colspan="2" | Default vertical
|-
| Question 1
| style="border-right: none;" |  Answer 1
|-
| Question 2
| style="border-right: none;" | Answer 2
|-
| Question 3
| style="border-right: none;" |  Answer 3
|-
| colspan="2" |  
|-
! colspan="2" | Default vertical
|-
| Question 1
| style="border-right: none;" |  Answer 1
|-
| Question 2
| style="border-right: none;" | Answer 2
|-
| Question 3
| style="border-right: none;" | Answer 3
|}
 
{| class="wikitable" style="width: 600px;"
! Compact horizontal || Question 1 || Question 2 || Question 3
|-
| #1 || Answer 1 || Answer 2 || Answer 3
|-
| #2 || Answer 1 || Answer 2 || Answer 3
|}
 
{| class="wikitable" style="width: 600px;"
! Compact vertical || Question 1 <br> Question 2 <br> Question 3
|-
| #1 || Answer 1 <br> Answer 2 <br> Answer 3
|-
| #2 || Answer 1 <br> Answer 2 <br> Answer 3
|}


=== Preview the result ===
=== Preview the result ===

Revision as of 17:34, 30 November 2020

Traditionally, inspections often involved a lot of paperwork - part of it in the field, and then again in the office, producing a report. Resco Inspections is designed to perform the entire inspection process without any paper documents, however, in many scenarios, it is desirable to finish the inspection with a report, a document that can be sent to your manager or end customer. Fortunately, Resco Inspections allows you to generate such reports directly on your device, immediately after concluding an inspection.

Resco Inspections comes with a generic report available automatically for all questionnaires, and it includes a powerful tool for designing custom mobile reports, the Report Designer. However, even if you are already familiar with the mobile reports in Resco, the unique data structure of questionnaires can sometimes complicate things.

Automatic report

The demo data includes the automatic report, a generic default report for any questionnaire. This report can be made available in the app without any additional configuration using Report Designer. Automatic reports are only available for the standalone Resco Inspections product.

The automatic report available out-of-the-box covers the scenario: one answered questionnaire = one report. If you want to cover multiple answered questionnaires in a single report, contact Resco support. For some platforms, we have created an experimental automatic report for a list of questionnaires.

Custom report

Click Mobile Report to create a report template from a questionnaire.

While editing a questionnaire using the Questionnaire Designer, you can click the Mobile Report button to open the Report Designer. This function takes the questionnaire structure and converts it into a custom report with the same structure. This new report is also linked to the questionnaire.

Alternatively, you can start Report Designer, create a brand new report from scratch, and link it to a questionnaire manually.

Editing questionnaire reports in the Questionnaire Designer

The following configuration options are available for customizing your reports directly in the Questionnaire Designer.

What to include

For each question, set whether it should be included in the report or not (in the Show on report parameter on the Properties pane).

  • All normal questions are included in the report by default.
  • Most static components are excluded by default; the only exception is the Logo.

Style and themes

Questionnaire reports come with pre-configured styles and themes.

  • To assign styles to questions, select a question, and on the Properties pane, set the reporting style.
  • To assign styles to header and footer, select the top element of the questionnaire and set the header and footer style on the Properties pane.
  • To modify styles manually, click Styles in the toolbar, switch to the Report Styles pane, and set the font, colors, and arrangement of question and answer. See Style editor for general information about styles.
  • To switch between pre-defined report themes, click Report Themes in the toolbar and select one of the themes. Selecting a new theme discards all changes in custom styles.

Group properties

One of the big shortcomings of the generic report is how question groups are displayed. Therefore, the report customization in the Questionnaire Designer offers multiple options for displaying groups. To configure these, select a question group and modify parameters in the Reporting section on the Properties pane.

The first two parameters, Show Header and Header Style, allow you to select if and how should the group header be displayed in the report.

The Questions Layout determines how the questions should be arranged:

  • Horizontal: questions are arranged next to each other in a row
  • Vertical: questions are arranged one below the other in a column
Horizontal layout
Question 1 Answer 1 Question 2 Answer 2 Question 3 Answer 3
Vertical layout
Question 1 Answer 1
Question 2 Answer 2
Question 3 Answer 3

In the Break After, specify how many questions should be listed in a single column or row before continuing to the next column or row. Note the different numbering order.

Horizontal layout, Break After = 3
Question 1 Answer 1 Question 2 Answer 2 Question 3 Answer 3
Question 4 Answer 4 Question 5 Answer 5
Vertical layout, Break After = 3
Question 1 Answer 1 Question 4 Answer 4
Question 2 Answer 2 Question 5 Answer 5
Question 3 Answer 3

Border Kind and Line Color determine if and how table cell borders should be drawn. The following options are supported:

  • Grid
  • Rows
  • Columns
  • Outside Border
  • No Border

For repeatable groups, you can additionally configure the Repeat Layout.

  • Default – each instance of a repeating group is rendered as a separate group with its own header
  • Compact – all instances of a repeatable group share a single header
Default horizontal
Question 1 Answer 1 Question 2 Answer 2 Question 3 Answer 3
 
Default horizontal
Question 1 Answer 1 Question 2 Answer 2 Question 3 Answer 3
 
Default horizontal
Question 1 Answer 1 Question 2 Answer 2 Question 3 Answer 3
Default vertical
Question 1 Answer 1
Question 2 Answer 2
Question 3 Answer 3
 
Default vertical
Question 1 Answer 1
Question 2 Answer 2
Question 3 Answer 3
Compact horizontal Question 1 Question 2 Question 3
#1 Answer 1 Answer 2 Answer 3
#2 Answer 1 Answer 2 Answer 3
Compact vertical Question 1
Question 2
Question 3
#1 Answer 1
Answer 2
Answer 3
#2 Answer 1
Answer 2
Answer 3

Preview the result

If you're working with Resco Cloud or Resco Inspections cloud backends, you can preview reports directly in the Questionnaire Designer.

  • Click Report on the toolbar to display the report preview.
  • Click Settings on the toolbar to set the Language of the previewed report, and the data (answers) of the Questionnaire that should be displayed. Use "Virtual" if you want to use empty/default values, or select one of the existing completed questionnaires as a data source.
  • Optionally, for selected questions, you can specify a Preview Answer on the properties pane.

Advanced: Editing questionnaire reports in the Report Designer

The most exhaustive configurator for mobile reports is the Report Designer. If neither the generic automatic report nor the report customized in the Questionnaire Designer is sufficient for your use case, you can set up questionnaire reports in the Report Designer.

Create a report

To create a mobile report for a questionnaire from scratch, proceed as follows:

  1. Start the Report Designer.
  2. Click New.
  3. As Entity, select "resco_questionnaire".
  4. As Create, select "From Template", then choose the questionnaire to serve as a source for your report.
  5. Set other options on the Create Mobile Report window as needed, then click OK.
  6. Once you're done editing the report, save all changes, and activate the report.

Make new report visible

To make the report available for users in the app:

  • In the Report Designer, make sure that the report is linked to the correct questionnaire. Also, make sure the report is active.
  • In the Questionnaire Designer, edit the questionnaire, click Edit, and choose the right report.

Images in questionnaire reports

If you are using the automatic report function available from the Questionnaire Designer that creates a report from the questionnaire, image-type questions and answers will be included, no extra effort is needed. However, if you are creating a custom report for a questionnaire from scratch, you need to perform a few extra steps to access the right images related to your questions.

When a questionnaire is saved, the image present on the questionnaire is saved as a record in the note/annotation entity. This entity has two important fields that contain the relationship between the questionnaire and the question where the image is set:

  • Regarding/objectid - contains the reference to the questionnaire
  • Title/subject - contains the reference to the question on which the image is saved

Both of these fields are needed to be used in the filter to get the note on the report.

The note entity is used for images if your backend is Resco Cloud or Dynamics. For Salesforce, use the contentversion entity instead. The fields have a different name but the general principle remains the same.

  1. Select the report body and click Edit Sources.
  2. Add a new variable of the type Fetch Result for the annotation entity.
  3. Define the appropriate filter.

Logo in questionnaire reports

Adding the logo of the questionnaire template to a report is even easier than adding an image related to a question. The logo is linked directly from the questionnaire and its title equals "-resco_logo".

  1. Select the report body and click Edit Sources.
  2. Add a variable of the type Fetch Result for the annotation entity.
  3. Define the appropriate filter.

Images from repeatable groups

In the case of images that are placed within repeatable groups, you need to adjust the annotation fetch according to the name, index, and repetition of the respective question group. When the question group is repeated on the questionnaire form, the name (field "resco_questiongroup.resco_name") is composed of the name of the question group defined in the questionnaire designer and the index of repetition, e.g. "my-question-group#001". The same works for each question placed within.

First, you need to create a child repeater for question group and add "resco_name" condition to the filer. Use the "Contains" operator and the name string from Questionnaire Designer. This way you make that each repetition will be fetched and used in the report's repeater. A good practice is also to define the sort order so that you get the question groups in the same order as on the questionnaire.

  1. Create a child repeater.
  2. Select the repeater and click Edit Sources, then double-click the filter.
  3. Click Add Condition and enter the condition for "resco_name".
  4. Save all changes.

Next, define the fetch for “resco_question” entity which will get the correct question record. You need this record to fetch the correct annotation record in the following step. The question filter should use “resco_questiongroup” condition for the question group from step 1 and condition based on the question name and index similarly as in the “resco_questiongroup” filter.

  1. Return to the list of variables of the child repeater.
  2. Click Add to add a variable for the entity "resco_question".

The final step is to place an image cell into the repeater and define the "annotation" entity filter. The "annotation.objected" must equal the id of the questionnaire and the "annotation.subject" must equal the name of the image question from step 2.

  1. Close the variables list and return to the questionnaire design.
  2. Select a cell in the child repeater grid and click Add Image.
  3. On the Properties pane, click Binding > Select and define a filter for the annotation.

Using JSON storage in custom reports

If you want to use a questionnaire component saved in JSON/compressed JSON format on your report, the fetch for this component must include an extra condition.