Starting with V10.0, Cora SeQuence has been renamed to Cora Orchestration.
V9.6 and later
Overview
The Preview Attachment control displays the file preview either in a pop-up window or in the set location in the case window. You can preview case attachments by adding the Preview Attachment control in your form or by adding the Preview Attachment client API to the form.
Currently, preview for the following file formats is supported:
- JPEG
- PNG
- GIF
- TXT
- CSV
- XLSX
- DOCX
- XLS
- RTF
For other file formats, the system downloads the attachment file to your computer.
NOTE
The preview functionality does not support Right-to-Left (RTL) languages, for example, Hebrew and Arabic.
Enable preview attachments
Set the following parameter in the Administration and Flowtime web.config file to enable or disable the attachment preview:
Parameter | Value |
---|---|
PNMsoft.Sequence.Components.PreviewAttachments.PreviewEnabled |
|
Set the maximum preview size
Set the following parameters in the appSettings section in the Administration and Flowtime web.config file, to add the maximum preview size for different types of attachments.
Parameter | Supported files | Default maximum preview size |
---|---|---|
PNMsoft.Sequence.Components.PreviewAttachments.AttachmentMaxSize | PDF, JPEG, PNG, GIF, TXT, and CSV | 4096 KB |
PNMsoft.Sequence.Components.PreviewAttachments.PassThroughAttachmentMaxSize | XLSX, DOCX, XLS, and RTF | 1024 KB |
For example:
<appSettings> <add key="PNMsoft.Sequence.Components.PreviewAttachments.AttachmentMaxSize" value="4096" /> <add key="PNMsoft.Sequence.Components.PreviewAttachments.PassThroughAttachmentMaxSize" value="1024" /> … </appSettings>
Preview attachments in a pop-up window
By enabling preview in the web.config file, one-click on the filename displays the preview in a pop-up window.
Preview attachments in a form
You can add the preview functionality to a form in two ways:
- Add a code snippet to the form source
- Add the Preview Attachment control from Toolbox
Add snippet to the form source
- In a workflow, add or edit a form or a task activity.
- Add the following script to the source in the relevant location.
<div> <sq:PreviewAttachmentView runat="server" ID="PreviewControl" Display="Static" Width="800" Height="500"></sq:PreviewAttachmentView> </div>
By default, the Display property of the Preview Attachment control is set to Static so it preserves space for the preview according to the given width and height. You can set the Display property to Dynamic to display the preview dynamically.
Add the Preview Attachment control from Toolbox
- In a workflow, edit a form or a task activity.
- Select from the Toolbox, Standard > Preview Attachment control.
Add the Preview Attachment control in the specific location in the form where you want to display the preview. - Save the form.
Display a file in the Preview Attachment control
The Preview Attachment form control has its own client API to display a file preview in the form.
Set the following function parameters to display a file preview in the form:
Function | Parameters | Description |
---|---|---|
previewAttachment |
| is called when a user clicks on an attachment to open a preview. For example, previewAttachment("85e6c44b-34df-4563-9f9f-c75037c68f12", "myfile.docx", 2147923637) |
The client API has the following events:
Events | Description |
---|---|
closePreview | is called when a user closes a preview. |
onNavigating | is called before navigating to the previewed file. |
onNavigated | is called after navigating to the preview file. |