Report Template Editor
Prerequisites
-
To use the PDF Report Template Editor, you need the following licenses:
-
To use the PDF Report Template Editor, you must:
-
To use the PDF Report Template Editor, you need:
Grant Access to Admin Tools
Access to Admin Tools is available to anyone with the ability to edit or update your org’s Static Resource files. This access can only be granted through Permission Sets to users with a Salesforce license. |
-
From Setup, enter "Permission Sets" in the Quick Find box, then select Permission Sets.
-
Click the link for the Permission Set Label you need to modify.
-
Scroll to the bottom of the page and select System Permissions.
-
Click Edit Properties.
-
Mark the Enabled checkbox for Customer Application.
-
Click Save.
-
Repeat steps 2-6 for any other permission sets as needed.
Basics
The PDF Template Report Editor provides an interface to create or modify the XML templates used in FieldFX Mobile to generate PDF reports, a type of FX Report.
PDF reports attach to records as PDFs, making it easier to print and email reports.
PDF reports give you the ability to use repeating headers and footers, pagination, and many other advanced formatting options.
The tool provides templates for commonly generated reports, easing the burden of creating reports.
XML Templates
An XML template is a file containing XML markup that controls the design and content of a PDF report.
XML templates use:
-
XML elements to define the report’s layout.
-
XML attributes to define appearance of XML elements.
-
Expressions and report helpers to define the report’s content.
You can create XML templates in a text editor.
PDF Metadata
-
The Report Template can be used to add PDF file metadata via an
<info>
tag -
Supported metadata attributes are:
-
title
- also used for the PDF filename -
author
-
subject
-
keywords
-
-
Report designers can use Handlebars expressions to add dynamic content to the metadata fields
-
If added manually, the
<info>
tag must be a direct child of the<template>
tag
Use "Job Safety Report" as the Report Title Each Time a Report Generates
In the title field of the Report Template, enter Job Safety Report
This adds the following to the XML for the report template:
<template>
<info title="Job Safety Report" />
</template>
Dynamically Use the Customer and a Timestamp for the Report’s Title
In the title field of the Report Template, enter the following Handlebars expression:
{{FX5__Customer_Account__r.Name}}-{{formatDate (formula "NOW()") format="MM/DD/YYYY HH:mm:ss"}}
This adds the following to the XML for the report template:
<template>
<info title="{{FX5__Customer_Account__r.Name}}-{{formatDate (formula "NOW()") format="MM/DD/YYYY HH:mm:ss"}}"/>
</template>
The resulting report might display as follows:
Getting There
-
Access the Admin Portal from https://admin.fieldfx.com.
-
Select the button on the Dashboard for Report Templates.
Figure 4. Report Templates is one of the tools available on the Admin Portal’s Dashboard page
How it Works
-
The Report Templates tool allows you to add new reports for Quotes, Jobs, Tickets, and Invoices.
-
Use the wizard to create or modify an XML template for the report.
-
Start from a preloaded format or create a new report from a blank template.
After creating the report with the wizard, advanced users can modify the XML directly. |
Considerations
-
Existing reports continue to work as designed, but may not be edited with the wizard tool.
-
Existing HTML report templates and XML report templates can be edited in the code editor within the tool.
-
New reports are created as XML templates.
HTML reports are deprecated and will not receive enhancements or new features. |
Best Practices
-
Be aware of the objects used for the report. Consider creating a diagram or writing down the objects and their relationships.
-
If defining the XML manually, use margins to assist in readability and accessibility of the report. Keep spaces at the edges of the report and between sections.
Margins are always set clockwise: Left, Top, Right, Bottom.
<table margin="36 40 36 40">
sets the left margin at 36, then the top margin at 40, then the right margin at 36, then the bottom margin at 40. -
Consider the content of the report data and whether a the width of a landscape orientation is better than the height of a portrait orientation.
-
If there is any chance of ever printing the report, always print an example.
Step by Step
Add a Logo File
The same logo file is used across report templates for the org. |
-
Select the button on the Dashboard for Report Templates
Figure 5. Report Templates is one of the tools available on the Admin Portal’s Dashboard page -
Click the Upload Logo button in the bottom right.
Figure 6. Click the Upload Logo button to add a new logo or replace an existing logo to use on all reports for the orgThe Template Logo Management displays a current logo on the left.
Figure 7. A preview of the uploaded logo displays on the Template Logo Management screen -
Click inside the dotted rectangle on the right with "Select File to Upload" to upload a new logo file
Use a file in .GIF, .JPG, .PNG, or .SVG format.
Transparent backgrounds work best.
-
Select the image file to use in your system’s file tool
-
Click Save
Create a New Report Template
Define the Report Parameters
-
Select the button on the Dashboard for Report Templates
Figure 8. Report Templates is one of the tools available on the Admin Portal’s Dashboard page -
Select the + New Template button on the top right
Figure 9. Begin creating a template by clicking the New Template button -
Select an example template to start from or choose Blank to begin from scratch
Figure 10. The Report Template Admin Portal Tool provides a number of templates for a quick start, or you can create a brand new report -
Enter a Report Name and select the Object for the report, then click Next
-
Select the Page Size for the report, then click Next
The orientation is selected in the next step.
-
Letter: 8.5" × 11"
-
Legal: 8.5" × 14"
-
A4: 8.3" × 11.7"
-
-
Select the Orientation of the paper for the report, then click Next
-
Portrait: Tall perspective
-
Landscape: Wide perspective
-
-
Add Optional Filters to control when the report is available:
All fields are optional.
-
Sequence Number: Order in which to display the template in a list of report options
-
Job Type: Record type for the
FX5__Job__c
object for which the template is valid. Select from the picklist values. -
Segment: Business segment for which the template is valid. Select from the picklist values.
-
Account: Customer account for which the template is valid. Enter two or more characters from the Account name to search.
-
Office: Office for which the template is valid. Select from the picklist values.
-
Record Type: Record type of the report’s selected object for which the template is valid. Select from the picklist values.
-
-
Click Next, then continue to create the report’s Header
Create the Report Header
The report header contains three columns
-
One column contains a space for the logo, if included.
-
One column contains space for a line of text, such as a report title.
-
A third column always on the right contains space for a table of data that is two columns wide and allows up to seven rows.
-
Choose whether the organization’s logo should appear:
-
Align the logo to the left of the page with the single line in the middle.
-
Align the logo in the center of the page with the single line to the left.
-
Do not include the logo. Single line column is left aligned.
-
-
Click Next
-
Customize the Header Properties that appear at the top of the report.
Fields in the header can be filled by any of:
-
Custom Text: Select the option and then enter the text that should display.
-
Page number and page count
-
Date
-
Results of a SOQL formula
-
Field from the report’s object
-
Add content for the single line field:
-
Select any of the following:
-
Blank field, then choose a field from the report’s object
-
Property, such as the number of pages
-
Date
-
Results of a SOQL formula
-
Custom Text to add a title or other heading for the report
-
-
-
Add content to the two-column table that displays in the top right of the page
By default, the wizard presents two fields.
Add additional fields by clicking Add Column to add a new row with space for two additional fields.You can add up to a total of seven rows.
Use the left column as the row label by selecting Custom Text as the field type, then replacing the words "Custom Text" with the label to use.
-
-
Click Next after adding all desired fields for the top of the report
Define the Table Contents
-
Select the Table Type that defines the main content the report displays.
-
Typically, reports list the Items for the object.
A Ticket Report would add a Ticket Items table type.
Figure 12. Specify the type of table for the main contents of your report-
Enter text in the unlabeled field to filter and select an option
or
Click the drop down to scroll through the list
-
Click Next after making the selection
Advanced users can skip this step and create the table in the XML code later.
-
Define the Columns that should appear in the table on the report:
-
Field: Data from the referenced object to display on the report
Enter the fields in any sequence.
The display order is defined on the next screen.For example, on a Ticket report of Ticket Items, the field from the
FX5__Ticket_Item__c
object to display on a Ticket report. -
Label: Heading to use for the column
-
Total Label: Description to display for the last row of the report
This option is only available for the Column selected as the Show column.
-
Show: Field to sum as the total amount
You can only select one Column Field to Show
The example shown creates a basic Ticket Item report with Quantity, Discount, Price, and Extended Amounts.
Figure 13. Add the columns that should display on the report, with labels and a total as desired
-
-
Click Next
-
Define how to sort entries on the table:
-
Sort by: Field to use to sort the table entries
-
Direction: Ascending to sort A-Z or from lowest to highest.
Descending to sort Z-A or from highest to lowest. -
Filter By Formula: SOQL query to limit records that display
Figure 14. Define how the data in the table should display with sort, direction, and filtering options
-
-
(Optional) Modify the column display order
Use the up and down arrows to change the display order.
Fields print in order from left to right based on this sequence.Figure 15. Use the up and down arrows next to the list of Column Fields to change the sequence they display from left to right across the report -
(Optional) Add Another Table to the report
-
Click Next
-
Add Terms and Conditions
-
Enter text that should display after the contents of the table
-
Copy and paste from another program or type in the field.
-
Most formatting copies well.Use the buttons to add headings or other formatting to selected text.
Figure 16. Add Terms and Conditions to your report with a familiar editing and formatting interface
-
-
Click Next
Add Signatures
Reports can contain slots for up to three signatures. |
-
Select the number of signatures required
Figure 17. If a report requires signatures, the wizard allows for up to three -
Click Next
-
If you added signatures, enter a descriptive label to print for each signature
For example,
Customer
,Supervisor
, orField Technician
Figure 18. Add the labels to use for each signature line -
After adding caption labels for the signatures, click Next
-
Select the type of Capture Signature Header to include, then click Next
The optional Capture Signature Header allows you to configure rows to text that display on the signature screen. Options are:
-
No Capture Header to not display additional text on the signature screen
-
Top to display the text above the signature box
-
Right to display th etext to the right of the signature box
-
-
(Optional) If you selected to include a signature capture header, add one or more rows of text to display in the Define Capture Signature Header Properties window
-
There are two columns per row
-
Select the available property to add from the list
-
Select Custom Text to add row labels or other static values, then select the pencil icon to customize the text that displays
-
Select Formula to enter a SOQL formula for the value to use
-
Use + Add Row to create additional row(s)
-
Select the red trash can icon to delete a row
-
-
Click Next
Add Report Footer
-
The optional footer allows for a main statement line and two places for additional fields.
-
Select the arrangement of the footer information
Figure 19. Select how the main statement and additional fields should appear at the bottom of each page -
Click Next
-
Add labels and fields to use in the Footer
If needed, you can add up to six additional rows to the two-column tables. Figure 20. Add fields to show in the footer, including adding additional rows to the tables as needed -
Click Finish
-
The report template is not saved until you finalize and save the report! |
Finalize the Report
A preview of the report displays.
-
Click on a section to make changes as needed
-
Use the Filters and Layout navigation panels on the left of the screen to modify report information
-
Click a report section to access additional edit options for the section
Figure 21. Select any section of the report preview to make changes if neededClick the table section to add a new table above or below the existing table.
If multiple tables exist, a trash can icon appears allowing you to delete a table.
At least one table must exist on the report.
Figure 22. The wizard allows you to add new tables, rearrange tables, or delete a table -
Click Preview in the top left to generate a sample report
Select a particular record to use for the sample when prompted.Figure 23. Preview the report by selecting a particular record’s data to use -
Add Optional Metadata
Metadata is additional information added to the PDF file.
The Report Template supports four pieces of metadata:
-
Document Title (also used for the file name)
-
Author
-
Subject
-
Keywords
You can use Handlebars expressions to include dynamic content in the report metadata.
-
-
Click Save in the top left to make the report template available.
Figure 24. Click Save to confirm changes and make the report available for records
Modify an Existing Report Template
-
Select the button on the Dashboard for Report Templates
Figure 25. Report Templates is one of the tools available on the Admin Portal’s Dashboard page -
Select the report template’s object from the list on the left
If the report is not for a Quote, Job, Ticket, or Invoice, select Other Templates.
Figure 26. Report templates are grouped by object or collected into "Other Templates" -
Select the template’s edit icon to modify the report template
Figure 27. Use the pencil icon for a particular report template to edit the report -
Select whether to use the XML code editor or the XML Wizard to edit the report
See the instructions for the wizard discussed above in the Create New Report Template section.
Reports that were created without the wizard and legacy HTML reports can only be edited using the code editor.
Figure 28. Choose whether to modify the report in the Wizard or the XML editor -
From the report wizard, click Save to save the changes to the report, exit the Template Wizard, and return to the report template list
or
From the code editor, click Save or click the Templates menu option to return to the report template list.
Figure 29. Click Save after making changes in the XML editor to return ot the Report Template list
Copy an Existing Report Template
-
Select the button on the Dashboard for Report Templates
Figure 30. Report Templates is one of the tools available on the Admin Portal’s Dashboard page -
Select the report template’s object from the list on the left
Use the Author and Filter dropdown options to narrow the list of templates.
If the report is not for a Quote, Job, Ticket, or Invoice, select Other Templates.
Figure 31. Report templates are grouped by object or collected into "Other Templates" -
Select the copy icon for the template to copy
Figure 32. Use the Copy button to duplicate an existing Report Template -
Confirm the copy by clicking Copy
-
From the Report Template selection screen, select the template and modify it using the wizard or code editor
Delete an Existing Report Template
-
Select the button on the Dashboard for Report Templates
Figure 33. Report Templates is one of the tools available on the Admin Portal’s Dashboard page -
Select the report template’s object from the list on the left
Tip: If the report is not for a Quote, Job, Ticket, or Invoice, select Other Templates.
Figure 34. Report templates are grouped by object or collected into "Other Templates" -
Select the trash can icon for the desired Report Template
Figure 35. The trash can icon deletes an existing report template -
Confirm the deletion by clicking Delete
This cannot be undone.
Troubleshooting
To display forms in the browser, you must disable the Google Chrome setting that determines whether the browser displays or downloads PDF files.
Google Chrome is a 3rd party application, and the instructions for how to disable this option may change at any time without warning. |
-
In Google Chrome, go to
chrome://settings/content/pdfDocuments
(Enter that path directly in the browser’s address bar.)
-
Verify the toggle for Download PDF files instead of automatically opening them in Chrome is disabled
Alternatively:
-
Access Google Chrome’s settings
There are several ways to do this, but one is to select the vertical dot Customize and Control button in the top right corner of the browser, then select Settings. -
Select Privacy and security in the left navigation bar
-
Select Site Settings
-
Select PDF documents
You may need to expand the Additional content settings group of options first. -
Verify the toggle for Download PDF files instead of automatically opening them in Chrome is disabled
Recommended Reading
-
Advanced users can take advantage of the Handlebars template library.