Difference between revisions of "Report Designer examples"

From Resco's Wiki
Jump to: navigation, search
(Signing reports at run time)
(Dynamic image)
(One intermediate revision by the same user not shown)
Line 11: Line 11:
 
== Dynamic image ==
 
== Dynamic image ==
  
Use dynamic images that depend on the record selected for the report. For example, consider a report for a single contact where you want to include that person's photo. The image is stored in the Annotation (Note) entity. The title (subject) of the image is always "ListImage" and its ID points to the ID of the Contact.  
+
Use dynamic images that depend on the record selected for the report. For example, consider a report for a single contact where you want to include that person's photo. The image is stored in the Annotation (Note) entity. The ID of the image points to the ID of the Contact. Ensure that the title (subject) of the image, for example, "ListImage", is unique.
  
 
::[[File:Dynamic image report designer.png|600px]]
 
::[[File:Dynamic image report designer.png|600px]]
 +
 +
We recommend that you add a [[Form#Add_media|Media tab]] to the [[form]] of the entity, where you can define the title (subject) of the note with the specific image/signature. This approach also ensures that there will only be one image with that note title.
  
 
== Multiply values ==
 
== Multiply values ==

Revision as of 13:41, 3 April 2020

This article describes several useful examples of using the Report Designer.

Static image

Use static images for images that should not depend on the record(s) selected for the report. For example, you can add your company logo to the header block.

  1. Edit your app project in Woodford, select Offline HTML from the Project menu, and upload your static image. In this example, we create a Reports folder and add the file image01.png. Publish your project.
    Image in offline html.png
  2. In Report Designer, select a cell in the header block and click Add Image. Set Binding Type to Constant. As Binding, enter the path to your image. In our example Reports\image01.png.
    Static image report designer.png
  3. Synchronize the project and verify the result in the app.

Dynamic image

Use dynamic images that depend on the record selected for the report. For example, consider a report for a single contact where you want to include that person's photo. The image is stored in the Annotation (Note) entity. The ID of the image points to the ID of the Contact. Ensure that the title (subject) of the image, for example, "ListImage", is unique.

Dynamic image report designer.png

We recommend that you add a Media tab to the form of the entity, where you can define the title (subject) of the note with the specific image/signature. This approach also ensures that there will only be one image with that note title.

Multiply values

There are situations where you don't want to display two fields directly, but you want to perform an arithmetic operation and display the result. In the following unlikely example, we multiply the latitude and the longitude fields of your accounts and display the product in the report.

  1. Select the Body element of your report and click Edit Sources.
  2. Click Add to add a custom variable that stores the result of the multiplication. Enter a name and type, then click OK.
    Custom variable in report designer.png
  3. Click On Create and add a rule that performs the multiplication, then close the rules editor and variable editor.
    On create rule report designer.png
  4. Add the field to your report.
    Multiplication in reports.png
  5. Verify the result in the app.

Cell visibility

You can control the visibility of a text block or image block by setting the Visible property.

In the following example, we list all contacts related to an account in a repeater block. We're using the Visible property to hide the text block in the header section of the repeater if an account has no associated contacts.

Create the repeater

  1. Edit the report for your account.
  2. Select the body of your report and click Add Repeater.
  3. Select the repeater, move it to the appropriate location of your report and click Edit Sources.
  4. Select the Item and click Edit. Change the Entity to contact and click OK.
    Add source for repeater.png
  5. Add the following filter, then click Save & Close.
    Filter for repeater.png
  6. Add the following text blocks to your repeater.
    Repeater.png

Manage visibility

  1. Select the body of your report and click Edit Sources.
  2. Add a new variable (myContact) of the Type Fetch Result for the Entity contact. Select it, click Edit, and add the same filter as above.
    Filter for repeater.png
  3. Add a new variable (myFlag) of the Type Boolean. Select it, click On Create and add the following rule:
    On create rule report designer 2.png
  4. Set the visibility of the text block in the header to depend on the boolean variable.
    Cell visibility in report designer.png
  5. Verify the result in the app. For accounts that have no associated contacts, the header cell should not be displayed in the report.

Automatic numbering of repeating blocks

In this example, we want to number the repeater blocks displayed in a report.

  1. Select the body of your report and click Edit Sources.
  2. Click Add and create a new decimal variable (count).
  3. Click On Create and initialize this variable to 1.
    Initialize variable 1.png
  4. Close the rule editor and variables on body level.
  5. Select the repeater and click Edit Sources.
  6. Click Add and create a new decimal variable (count2).
  7. Click On Create and add the following steps.
    Initialize variable 2.png
  8. Close the rule editor and variables on body level.
  9. Add the the second variable to your report.
    Add count to repeater.png
  10. Verify the result in the app.

Adding signatures to reports

Report Designer offers several ways of adding signatures to reports.

  • On some reports, it is sufficient to use a static signature. In these cases, consider saving the signature as an image to the Offline HTML and then add the image to the report using Report Designer. See the section for static images above.
  • Alternatively, you may want to save the signature image as a note, related to a record. For this scenario, you can study the section for dynamic images, or read our blog. Blog
  • Resco Mobile CRM can be integrated with a third-party solution from DocuSign. See how to Add legally-binding digital signatures. Blog
  • With the most recent addition to Report Designer, you can designate a place on your report, where you can add signature(s) and comment(s) at run time. This approach allows you, for example, to generate a report that the customer can view on your device, then sign it, and optionally add some comments. Once saved, the signature and comments are added to the report. This scenario is described below.

Signing reports at run time

Signature properties.png

Report Designer can be configured to use enhanced signature workflow which allows signing generated reports directly in the app.

Adding a signature
  1. Edit a report.
  2. Select an appropriate location on the grid, then click Add Signature.
  3. Configure the signature on the Properties pane:
    • Check Enhanced signature to enable the workflow that allows you to sign a generated report.
    • Use Binding to set the label of the signature on the report. If your Binding Type is a constant, enter text directly; if your Binding Type is a value, you can link to a record field.
    • In the Signature storage field, select the entity where the captured signature image should be stored. In the Signature field, select the file name prefix for the image.
    • In the Report entity field, select the entity used for the report.
    • In the Comment field field, select the entity field where the signature comment should be saved. See also the notes about the signature comments below.
Multiple signatures
  • You can add multiple signatures to one report.
  • Make sure to use a distinct name for each of the captured signature images.
  • Also, use a distinct field name for each comment.
Signature comments
  • Each person signing the report can also add a comment to the report.
  • The comment is saved to a field defined in the properties of your signature, in the field Comment field. Leave the field empty if you don't want to allow comments.
  • This must be a Single Line of Text or Multiple Line of Text type of parameter. The field must also be enabled in the Woodford project. App users must have permission to read, create, and update the field.
Report comment.png
  • This comment is not displayed on the report automatically, you have to place it, just like a regular text field, using the Add Cell button.
See also YouTube