Open (or email) a PDF or Word document Generated by a Document Template
- Properties
- Layout Print Definition
- Document Template name
- Initial view
- Display PDF using PDFViewer control
- Email Document
- Target Window, DIV, Tabbed UI Pane
- Target
- Window name
- Window type
- Lock overlay CSS class name
- Sub-theme
- Dock window
- Dock location
- Window Buttons
- Has custom toolbar buttons
- Optional Window Parts
- Show top bar
- Show bottom bar
- Show header
- Show footer
- Client-side Events
- Before execute event
- After execute JavaScript
- Window JavaScript Events
- onInitialize
- onShow
- onHide
- Ajax Failed/Offline JavaScript
- Offline JavaScript
- Videos
- Videos
- Dialog Window - Full View - Default
Description
Open Document Template is an Action Javascript action. The Open a Document Template action can be used to render a Document Template in either PDF or Microsoft .docx format. In the case of the PDF option you can display the PDF on screen in a window, DIV or TabbedUI pane, or you can email the document. In the case of a .docx file, you can email the document or call an Xbasic function to process the file after it is created.
Properties
Layout Print Definition
Document Template name
Specify the document template name.
Initial view
Specify if the document should be rendered as a PDF document or Microsoft Word (.docx).
Display PDF using PDFViewer control
Display the PDF using the PDFViewer control. (If you don't check this property, the document is shown in an IFrame).
Email Document
Specify if the document should be sent via email after it is generated.
Target Window, DIV, Tabbed UI Pane
Target
Specify if the document should be opened in a pop-up window, a DIV on the page, or (if running in a Tabbed UI) in a new Tabbed UI pane.
Window name
Set to <Default> to give the window a default name. If you give it an explicit name (which must be unique), you can execute methods of the window object.
Window type
Specify the window type. Popup windows will show in a movable window on the page. Dropdown windows have no title bar and cannot be modal.
Lock overlay CSS class name
Specify the CSS class for the overlay behind the window. Leave blank or specify <Default> for the default style, or <Invisible> for a transparent overlay.
Sub-theme
(Optional) Specify a sub-theme for the window. Leaving this blank selects the 'base' sub-theme.
Dock window
Docked windows 'stick' to an edge of the screen and remain in place even when scrolling.
Dock location
Specify which edge of the screen the window is docked to.
Window Buttons
Has custom toolbar buttons
Specify if the window has custom buttons in the window toolbar.
Optional Window Parts
Show top bar
Specify if a top bar should be shown inside the body container.
Show bottom bar
Specify if a bottom bar should be shown inside the body container.
Show header
Specify if a header should be shown above the window body.
Show footer
Specify if a footer should be shown below the window body.
Client-side Events
Before execute event
Specify the name of a JavaScript function to call before opening the target Report.
After execute JavaScript
Specify the JavaScript code to run after the Report has been printed.
Window JavaScript Events
onInitialize
Specify JavaScript to execute when the window is first shown.
onShow
Specify JavaScript to execute when the window is shown.
onHide
Specify JavaScript to execute when the window is hidden.
Ajax Failed/Offline JavaScript
Offline JavaScript
JavaScript to execute if the device is offline.
Videos
Creating and Printing a Document Template
Document Templates can be used to merge JSON data into a template to create a .pdf file or a Microsoft Word .docx file. In this video we show how some static JSON data is merged into a Document Template. The Document Template is created from an HTML string that included placeholders for field values.
Videos
Creating a Document Template by Importing a Report Definition
In this video we show how a Document Template is created by importing a report definition.