Enabling JSReport preview
The JSReport preview implementation in Brightspot offers editors the invaluable capability to visualize how JSReport-generated documents will look as they create assets. This functionality enhances the content creation experience by providing a real-time preview of the documents, ensuring they meet the desired format and appearance.
Key Details:
- Real-Time Document Preview—Editors can preview JSReport-generated documents directly within the Brightspot interface, gaining immediate insights into the document's appearance during the content creation process. This feature leverages the standard Brightspot preview system, so editors can view the preview within the content edit form in a separate browser tab.
- PDF and Microsoft Office suite support—Preview for both PDF and Microsoft Office documents (Word, Excel, Powerpoint) are supported. For Microsoft Office, the documents must be uploaded to a Microsoft endpoint for preview to function.
- View System based document generation—The preview system requires using the Brightspot view system for converting Brightspot data models into the JSON that is sent to JSReport, as described below.
- Simple Configuration—Some simple configuration is required in Sites & Settings to enable the preview.
View System
Each content type providing a JSReport preview must have an associated ViewModel
class that implements the interfaces JsReportMicrosoftOfficePreviewEntryView
and/or JsReportPdfPreviewEntryView
. Implementing these interfaces marks the ViewModel
as the entry point for generating the JSON that will be sent to JSReport to generate the document.
Configuration
To enable JSReport preview:
- Click > Admin > Sites & Settings.
- In the Sites widget, select the site for which you want to configure JSReport preview, or select Global to configure JSReport preview for all sites.
- Expand CMS > Preview.
- Under Preview Types, add a JS Report Microsoft Office or JS Report PDF preview type configuration. Under this object, add one or more configurations with the following fields set:
- Data View—This is the
ViewModel
that would be used. - Template—The JSReport template to use in the preview. This has a default value if the
ViewModel
selected under Data View has a@DefaultJsReportTemplate
annotation.
- Data View—This is the
Previous Topic
JSReport document generation API
Next Topic
JW Player