Create the Sheet Structure
    • 13 Dec 2024
    • 10 Minutes to read
    • Contributors
    • PDF

    Create the Sheet Structure

    • PDF

    Article summary

    For the following types of output format, you must define the structure of the output data:

    • XML

    • JSON

    • XHTML (XML-based)

    • CSV

    • EDI

    • DataSet

    • PDF Form (Filled)

    • XSLX

    For example, for XML output you must create the structure of the XML document. For CSV output you must specify the data fields that the CSV output will contain. For XLSX output you must specify where in the spreadsheet Lasernet will insert data.

    Note

    EMF-based EMF, PDF, and TIFF outputs have a prespecified page-based structure. Rich-text-based DOCX, PDF, and XHTML outputs have a single-page based structure. So, for these types of output you do not need to create a sheet structure; instead, you can proceed straight to adding text, input data, and other elements to the form design.

    Follow the instructions below that correspond to the sheet’s output type:

    XML

    You can create the structure of the XML output file using any of the available tabs in the output: XML or Template. Use the XML tab to create a structure by adding nodes in the right-hand panel of Lasernet Form Editor. This is done by right-clicking the XML tags and choosing the Add Child Node or Add Sibling Node menu depending on the hierarchy that you wish to design.

    Note that if you detach a merged rearrange in XML output you need to specify the node where you want to put the detached rearrange. For more information about merging and detaching rearranges see Merge Rearranges.

    With that, you can directly edit a plain text representation of the XML output file on the Template tab:

    It is possible to view the final result of the output without processing the job via the Lasernet Server. To do this, click the Preview button on the toolbar.

    Use an XML Template

    Lasernet supports the loading of pre-defined XML or XSD templates. This enables you to receive an external template file and import it into your Lasernet project to achieve significant time savings in the design phase.

    The template is imported into a Lasernet project. This is done on the XML tab of the output by right-clicking the node where the template should be inserted and choosing Insert XML Template in the context menu. It brings up the Import XML Template dialog allowing you to browse for a template file with the .XML extension.

    After selecting the template to import, the Import XML template window changes, allowing you to specify how to merge the XML template with the existing XML file.

    This dialog window has the following controls:

    Control

    Description

    Enable default values

    When an XML template file is imported with Enable default values selected, all nodes that will be created/updated as a result of the operation will have the option Show node with default value if no rearrange data is provided checked.

    Drop-down list:

    Option

    Description

    Add all children

    Take all children of selected input node and append as children of the output node.

    Replace all children

    First remove all children of the output node and then add all children of the input node as children of the output node.

    Add input node as child

    Append the selected input node as a child of the output node. The children of the selected input node will then become grandchildren of the selected output node.

    Rename output node

    Change the name of the selected output node to the name of the selected input node

    When you have imported the XML template you can add, modify or delete the nodes as necessary to reach your final output format. The various tags are then mapped to rearranges on the input side and all tags are included in the final XML output files.

    Property or Setting

    Description

    Type

    Select the type of the node: Element, Attribute, CDATA, or Text (available only for nodes with a child node).

    Name

    Specify the name of the node.

    Default value

    Specify the default value (optional).

    Description

    Specify a description of the node which is then shown on the Edit Rearrange and Pattern Properties dialogs.

    Remove node if no data is provided

    Check to exclude empty nodes from the output. This setting has no effect in the Design mode.

    Use default value if no rearrange data is provided

    Check to use the default value if no rearrange data is provided.

    Use default value if rearrange data contains an empty string

    Check to use the default value if the rearrange data contains an empty string. This setting has no effect in design mode.

    Maximum value length (Design mode only)

    Specify a maximum number of symbols in the node value to be shown in the output. The setting is applied only in the Design mode.

    UTC Date and Time

    Define a format of the output rearrange data as UTC Date and Time by selecting the check box.

    Status Flag

    Specify a status for the selected node. You can use one of the available statuses to mark a node as:

    • None (no status is applied).

    • Complete (a node is completely processed and ready to be published in the output).

    • Tentative (a node is partially processed and not ready to be published in the output).

    • Not complete (a node has not been processed yet and is not ready to be published in the output).

    The node status is only displayed in the editor and does not affect the final view of the output document.

    It is possible to enter default values for the individual nodes, which can be used when there are no rearranges connected to the node or if the rearrange data contains an empty string.

    In addition, you can add a template with a predefined structure by clicking the Open Template button on the toolbar being on the Template tab of the output. In this case, you do not need to specify how XML template is to be merged with the existing XML file. Being open, the template is inserted directly to the output and substitutes any information previously entered on the Template tab.

    JSON

    You can create the JSON output structure from scratch. You can do it either on the JSON tab or on the Template tab.

    Use the JSON tab to create a structure by adding nodes. This is done by right-clicking a JSON tag and selecting the Add Child Node or Add Sibling Node menu depending on the hierarchy that you wish to design.

    Otherwise, you can create a structure using a plain text representation of the JSON output file directly on the Template tab.

    You can import a pre-defined JSON template to your Lasernet project in order to achieve significant time savings in the design phase. To do this, click the Open Template button on the toolbar.

    The difference between the XML and JSON output lies in the type of nodes. Below, you can find a list of node types for the JSON output:

    Unlike XML output, JSON format does not allow you to have two or more nodes with the same name on the same hierarchy level. If you want to add a multi-line pattern to the JSON output, you must add it to an element of an array.

    XHTML (XML-based)

    To add content to the form, you can also use a template with a predefined structure and, if needed, edit it further. The added template substitutes any information previously entered on the Template tab. To do this, click the Open Template button on the toolbar.

    In addition, you can add, modify or delete nodes as necessary to reach your final output format. Working with the XHTML output, it is possible to define the node value as a preformatted text. XHTML is the only output format for which this option is available. To this end, select the Preformatted text checkbox in the Node Template Properties dialog. As a result, whitespace is preserved for such text by the browser. The text only wraps on line breaks.

    For more information about controls of the Node Template Properties dialog, see the descriptions of the Node Template Properties controls in the Use an XML Template area within the XML section of this page.

    Edits made to the HTML code have priority over edits on the Template tab in case of substitution (the former substitutes the latter).

    CSV

    The Template tab is designed to create, edit and at the same time preview the structure of the CSV output. The lower part of the tab is used for fields; the upper part is used for previewing the final result. Buttons located at the bottom of the tab are for adding fields and managing them.

    A field has the following parameters:

    • Name

    • Width: each field contains the column data. For column separated files, the width attribute is used for setting the width of the column. The default value is 20.

    • Alignment: the alignment attribute can be set to either left or right. By default, left is assumed.

    EDI

    The Template tab is designed to create, edit and preview the structure of the EDI output. Here you can create a template by yourself or open an existing one by clicking the Open Template button on the toolbar and then edit it if needed.

    DataSet

    To create an output structure, follow the steps listed below:

    1. In the output, switch to the Template tab.

    2. Drag the required element from an available input on the left-hand panel of Lasernet Form Editor to the Template tab of an available output on the right-hand panel of Lasernet Form Editor.

    3. When you release the button, the structure is added and displayed on the Template tab.

    4. Afterwards, you can edit the output structure, if required. To do this, you can add/edit a table or a table column:

      • On the Template tab, right-click a node element of the structure and then click Add Table or Edit Table from the context menu. In the dialog box that appears, type a table name or change the existing one, and then click OK.

      • To add/edit a column, right-click the table and then click Add Column/Edit Column on the context menu. In the dialog box that appears, type a column name or change the existing one, select a data type for the column and then click OK.

    5. To connect a certain element of the output structure with a required pattern or rearrange added in the input, switch to the XML tab. From the XML tab of an output, you can customize or expand the structure you have added in your output.

    Open Template

    Once you have created an output structure, you can save it for later by using the preview functionality (on the toolbar, click the Preview button, and then click the Save button indicating the file name and the file location) and use it as a template when creating a new DataSet output. To this end, click the Open Template button on the toolbar, select and open a file you have previously saved as a template.

    PDF Form (Filled)

    To specify the structure of the data output, follow the steps listed below:

    1. In the sheet of the PDF Form (Filled) format, which is already open, click the Open Template button and select a template containing fields (interactive elements).

    2. Once you click the Open button in the Open Template dialog box, you are prompted to select whether to embed a file into the form or just to refer to that fle. You can choose among the following options:

      • Copy to resource location: Allows copying a file you select to the PDF Forms folder of the Configuration Resources location. As a result, the form refers to the file which has been copied to the resource location.

      • Original file location: Allows the form referring to the selected file directly on disk, making it possible to change that file on disk without having to open a configuration, load a new template, as well as commit and deploy. If any changes to the template file imply adding interactive elements which are supposed to be used in Lasernet, the template shall be re-open.

      • Embed file: Allows using a template embedded with the form.

    3. Once you open a template, switch to the XFDF tab. Based on the template, an XFDF (XML Forms Data Format) structure is generated here.

    You can now add rearranges to the input and drag them to the value elements of field elements in the output structure.

    XSLX

    To specify where Lasernet will insert data into the spreadsheet, follow these steps:

    1. Create a template for the report in the output or open a previously created template.

    2. Specify a template range.

      1. Select the cell range that outlines the template region and then click the Detail button () on the Mail Merge Extended toolbar.

      2. On the Mail Merge Extended toolbar, click the Select Data Member () button. With the Select Data Member dialog displayed, select a mail merge table as a data member for the worksheet data set.

      3. Add a nested level to the Detail range to display the detail-level data from the child table. To do this, select the required cell range to outline the Detail range and then click Master-Detail > Detail Level. As a result, the DetailLevel0 range is created.

      4. On the Mail Merge Extended toolbar, click Master-Detail > Data Member to specify a nested data member for DetailLevel0.

    The next steps is to add data fields to the area. See Add Input Data to a Sheet.

    JobInfo for Sheet Name Substitution

    You can use a JobInfo to substitute a name of a sheet in the XSLX file. It means that a sheet of the XSLX file can have not a fixed name, but the one you can change when running the corresponding JobInfo.


    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.