Introduction
The Live Template Editor in QBench LIMS is a flexible tool designed to help users create, modify, and manage customized reports with ease. It allows for dynamic editing and customization, ensuring your reports meet specific requirements for data presentation and analysis. By leveraging this editor, users can optimize their reporting workflows and maintain consistency in data handling.
What is the Difference Between the Visual Editor and Live Template Editor?
The Visual Editor is the graphical interface used to set up and design templates. The Live Template Editor, on the other hand, enables dynamic, real-time editing of templates and integrates editable fields into reports. Both tools complement each other to deliver a seamless reporting experience.
Use Case:
- A lab admin designs a Certificate of Analysis (CoA) template in the Visual Editor.
- Before generating the report, the technician uses the Live Template Editor to update specific results dynamically and preview the final document.
Table of Contents
- Reporting
- Dynamic Template Fields
- Special Classes
- Troubleshooting
- Conclusion
Reporting
Creating a Live Report Template
To create a live report template:
- Navigate to Configuration > Application > Templates > Reports.
- Click on + New Report Template Configuration in the top right corner.
- Select Visual Editor as the Editor Type and ensure the Live Report option is checked (this cannot be enabled after creation). Click Save to confirm your settings.
Creating a Live Report
After setting up a live report template:
- Navigate to an order, sample, or test (depending on the report level configured).
- Go to the Reporting tab and click Generate Report.
- Select the appropriate report type and follow the on-screen steps. At the final step, choose Create a Live Report, then select your signature if required.
- The live report will appear in the Live Reports table on the Reporting tab once generated.
Editing a Live Report
To make changes to a live report:
- Open the Live Reports table under the Reporting tab for the relevant order, sample, or test.
- Click the pencil icon next to the report you want to edit.
- From here, you can use dynamic template field editing, movable mode for rearranging elements, and resize images.
- Preview changes in PDF format by clicking Preview.
- Save progress at any time with Save Report Progress and return later if needed.
Generating a Report from a Live Report
Once your edits are complete:
- Open the live report in the editor by clicking the pencil icon for the desired Live Report.
- Click Generate Report to finalize and create the output.
- The completed report will appear in the Reports table under the Reporting tab.
Dynamic Template Fields
Fields
Dynamic template fields provide editable placeholders in live reports, ensuring flexibility without compromising the original data integrity.
Field Type | Description | Example Use Case |
Text Fields | Single-line text inputs | Sample ID: "12345-678" |
Text Box Fields | Multi-line text inputs | Detailed observations |
Numeric Fields | Numeric inputs | Reporting test results: pH: "7.4" |
Rich Text Fields | Formatted text inputs | Adding a styled CoA summary with bold headers and bullet points. |
Hyperlink Fields | Clickable links to external resources | Linking to SOP documents or compliance standards. |
Supported Editable Field Types and Examples
Text Fields:
- Description: Edit a concise text description of a sample or order (e.g., "Sample collected from Site A").
- Technician Name: Update the name of the assigned technician (e.g., "John Doe").
- Customer Name: Modify the customer's name for the associated order.
Text Box Fields (Multi-Line Text):
- Test Observations: Record detailed observations during a test or experiment.
- Customer Notes: Include special instructions or additional details provided by the customer.
- Order Comments: Capture internal notes for a specific order, such as handling instructions.
Numeric Fields:
- Test Results: Input or update numeric results, such as measurements or calculated values (e.g., "pH: 7.4").
- Quantity: Edit quantities for batch testing, such as "Number of Samples: 10."
- Price/Rate Fields: Adjust numerical data like billing rates or discounts.
Rich Text Fields (Formatted Text):
- Certificate of Analysis (CoA) Summary: Add or update a formatted summary with bold, italics, or bullet points.
- Internal Reports: Include detailed, styled text for internal documentation, such as analysis summaries.
Hyperlink Fields:
- Reference Links: Add or edit URLs pointing to external references, such as standards, protocols, or regulatory documents.
- Attachment Links: Update links to files or reports associated with the entity.
Creating a Dynamic Template Field
- In the Visual Editor, click Insert Variable.
- Select a field to include in the report and check the Dynamic Template Field option.
- The field will appear with an orange border, indicating it is editable.
Editing a Dynamic Template Field
- Open the live report in the editor.
- Click on the dynamic template field to modify its value.
- Save changes by clicking Update Value and Report, which updates both the live report and the original field.
Attachments
Creating a Dynamic Template Attachment
- Insert an attachment into the visual report by selecting Asset and Insert as Image.
- Ensure the Dynamic Template Field checkbox is selected before inserting.
- The attachment will appear with an orange background, indicating it can be edited.
Editing a Dynamic Template Attachment
To edit an attachment:
- Open the live report and click on the attachment.
- Drag the attachment to reposition it.
- Hold Shift while dragging to resize the attachment without maintaining the aspect ratio.
- Click Preview to see changes in PDF format.
- Save your progress after making changes.
Special Classes
Movable Container
Admins can add the class qbench-live-editor-movable-container and qbench-live-template-non-editable to an HTML element using the "Tools" > "Source Code" editor when setting up your report config in the Visual Editor.
To move the containers when editing a Live Template:
- Click on the "Enable Movable Mode" button.
- This will highlight all available movable containers with a yellow border.
- Click on the first container you would like to move.
- This will highlight your selected container with a green border.
- Click on the container you would like to swap the selected container with.
- Finally, click "Disable Movable Mode" and save your changes by clicking the "Save" button.
Demo:
https://www.loom.com/share/ce185dd528584831a9c1f70cef40b38e?sid=31d38e79-0a6c-4576-a8c6-94cdf219359f
Increment Value
Admins can add the class qbench-live-editor-increment-value to an HTML element to have its content increment (1, 2, 3, ...) whenever its position is moved in the Live Editor.
You can optionally use data-live-editor-increment-name as an attribute on the span to have different number groups that increment separately.
Example:
<span class="qbench-live-editor-increment-value" data-live-editor-increment-name="sample_count">1</span>
Re-syncable Template Macros
Admins can specify in a Template Macro that it is "re-syncable" when rendered inside of a live report. All that is needed is to include a wrapper div around your template macro content with the class qbench-live-editor-resync-template-macro and the data attribute data-template-macro-id="<INSERT_TEMPLATE_MACRO_ID>".
Here is the code used in the video above. Make sure you change the template macro ID in the container div!
<div class="qbench-live-editor-resync-template-macro" data-template-macro-id="<TEMPLATE_MACRO_ID>">
{% for attachment in order.get_included_report_attachments() %}
<div>
Order ID: {{order.get_display_id()}}<br/>
<img class="qbench-dynamic-template-variable qbench-live-template-allow-object-resizing" style="width: 100px; height: 100px;" contenteditable="true" src="{{ attachment.asset.id | download_file_and_base64_encode }}" alt="" data-asset-id="{{ attachment.asset.id }}">
</div>
{% endfor %}
</div>
Troubleshooting
General Issues
-
Issue: The "Live Report" option is not available when creating a new report template.
- Solution: Ensure you selected "Visual Editor" as the editor type. The "Live Report" option cannot be enabled after creation.
-
Issue: Changes made to dynamic fields are not saved.
- Solution: Always click "Update Value and Report" to apply changes and save them to the original entity.
Attachments
-
Issue: Image quality is poor after resizing an attachment.
- Solution: Use higher-resolution images when inserting attachments into the report.
Conclusion
The Live Template Editor empowers users to create and customize dynamic reports in QBench with ease. Whether you're editing test results, adding attachments, or using advanced features like Movable Containers and Increment Values, this tool ensures accuracy and efficiency in your reporting workflows. For further assistance, refer to the demos provided or contact QBench support.
Comments
0 comments
Please sign in to leave a comment.