HTML Report Setup (Deprecated)
This feature has been deprecated, will receive no further updates, and no longer supported. Instead, use XML reports and the Report Template Editor in the Admin Portal. |
Prerequisites
-
Read the following articles before you set up HTML reports for the first time:
-
To set up HTML reports, you need the following licenses:
-
To set up HTML reports, you must:
-
To set up HTML reports, you need:
-
System permissions:
-
Customize Application
-
Manage Profiles and Permission Sets
-
View Setup and Configuration
-
Basics
A HTML report is a type of FX Report.
HTML Templates
-
A HTML template is a file containing HTML markup that controls the design and content of a HTML report.
-
HTML templates use:
-
CSS attributes to define the report’s layout and appearance.
-
Expressions and report helpers to define the report’s content.
-
-
You can create HTML templates in a text editor.
Setting Up the HTML Reports Feature
-
Upload the en_US file:
-
From Setup, enter "static" in the Quick Find box, then select Static Resources
-
Complete one of the following:
-
If the en_US file displays in the list, proceed to step 4.
-
If the en_US file doesn’t display in the list, proceed to step c.
-
-
Unzip the file and extract it to your local computer
-
Move back to FieldFX Back Office
-
Click New
-
Complete the following:
-
In Name, enter "en_US"
-
In Cache Control, select "Public"
-
Click Choose File
-
Select the en_US file you downloaded
-
-
Click Save
-
-
Configure static resources:
-
From Setup, enter "file upload" in the Quick Find box, then select File Upload and Download Security
-
Click Edit
-
For ".html, .acgi, .htm, .htx, .shtm, .shtml", select "Hybrid" in Download Behavior
-
Click Save
-
-
Configure Salesforce Files settings:
-
From Setup, enter "general" in the Quick Find box, then select General Settings
-
Click Edit
-
Select Enable Files Sync
-
Deselect Files uploaded to the Attachments related list on records are uploaded as Salesforce Files, not as attachments
-
Click Save
-
Adding a HTML Report
-
Create a HTML template for the report:
-
Open a text editor
-
Add a new file
-
Set the
<!DOCTYPE>
:<!DOCTYPE html>
-
Add
<html>
tags:<!DOCTYPE html> <html> </html>
-
Enter CSS attributes to define the report’s layout and appearance
-
Enter expressions and report helpers to define the report’s content
-
Save the template as an .html file
-
-
Add a report template for the report:
-
Open the Report Templates tab
-
Click New
-
In Report Template Name, enter a name for the report template
-
In SObject, enter the API name of the object for which you are adding the report
Example 1. For a report about Ticket recordsEnter
FX5__Ticket__c
if the report is for the Ticket object. -
Specify when to use the report:
-
In Sequence Number, enter a sequence number to use for the report
Sequence numbers control the order of reports in lists. Refer to the Sequence Number article for more information.
-
Click Save
-
Click Attach File
-
Click Choose File
-
Select the XML template you created in step 1
-
Click Attach File
-
Click Done
-
Add a Visualforce page for the report:
-
From Setup, enter "pages" in the Quick Find box, then select Visualforce Pages
-
Click New
-
In Label, enter a name that corresponds to the object for which you are adding the report
Example 2. If the report is for TicketsEnter "Ticket Report" if you are adding a report for the Ticket object.
-
In Name, enter the report’s name with underscores for spaces
-
Copy the following code:
<apex:page standardController="ObjectName" extensions="FX5.ReportTemplateExtension"> <apex:includeScript value="{!$Resource.FX5__jquery1102minjs}"/> <style type="text/css"> div.apexp { margin-left:-10px; } body { margin-left:0px !important; } a { text-decoration:none; } </style> <script type="text/javascript"> $('td.labelCol.empty').remove(); $('td.dataCol.empty').css('width','50%'); $('td.labelCol.first').css('vertical-align', 'bottom'); $('td.dataCol.first').css('vertical-align', 'bottom'); $('input[type=submit]').appendTo('td.dataCol.empty'); function jsOpenReport(entityId, templateId, objectTypeId, namespace) { var pagePath ='apex'; var ctrl = document.querySelectorAll("[id$='reportPagePath']")[0]; var customUrl=''; if(ctrl!=null) { pagePath = ctrl.innerText; if(pagePath && pagePath.toLowerCase()!='apex') { customUrl='&customUrl=' + pagePath; } } var href = '/' + pagePath + '/' + namespace + 'Reporting?templateId='+ templateId + '&objectId=' + entityId + '&objectType=' + objectTypeId + customUrl; window.open(href, '_blank'); window.top.location=window.top.location; } </script> <div style="display:none;"> <apex:outputText id="reportPagePath" value="{!PagePath}" /> </div> <apex:dynamicComponent componentValue="{!form}" id="dynamic"/> </apex:page>
-
Replace the code on the Visualforce Markup tab by pasting over it with the code you copied
-
In the first line of the code, replace "ObjectName" with the API name of the object for which you are adding the report
If the report is for Ticket records<apex:page standardController="FX5__Ticket__c" extensions="FX5.ReportTemplateExtension">
-
Click the Version Settings tab
-
Click -- Select to Add Installed Package -- and select "FieldFX Base Package"
-
Click Save
-
-
Update page layouts:
-
From Setup, enter "object" in the Quick Find box, then select Objects
-
Open the object for which you are adding the report
-
Under Page Layouts, click Edit next to a page layout for FieldFX Back Office
-
On the toolbar, click Visualforce Pages
-
Drag Section from the toolbar to a suitable location on the layout
-
In Section Name, enter "Reports"
-
Under Layout, select 1-Column
-
Click OK
-
Drag the Visualforce page for the report into the Reports section
-
Click Save on the toolbar
-
Repeat steps c to j for other page layouts as needed
-
-
Grant permission to use the Visualforce page for the report:
-
From Setup, enter "permission" in the Quick Find box, then select Permission Sets
-
Open a permission set for Visualforce pages
-
Under Apps, click Visualforce Page Access
-
Click Edit
-
Add the Visualforce page for the report to Enabled Visualforce Pages
-
Click Save
-
Repeat steps a to f for other permission sets as needed
-
-
Test the report:
-
Open a record
-
Move down to the Reports section
-
Click the button for the report
-