Open (or email) a PDF or Word document Generated by a Document Template

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

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

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

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

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.

Dialog Window - Full View - Default

images/Open__or_email__a_PDF_or_Word_document_Generated_by_a_Document_Template.png