CSV Output
    • 08 Oct 2024
    • 2 Minutes to read
    • Contributors
    • PDF

    CSV Output

    • PDF

    Article summary

    An output can be created in the CSV format. The Form Engine retrieves data from the input grab file, processes it, maps it to fields in the output, and automatically converts the result to CSV.

    In this exercise, you are proposed to create a structure of the output in the CSV format.

    Exercise

    Download and import the attached configuration called 03. CSV Output in Lasernet Developer 9. Afterward, navigate to the Forms section and open the Sample form.

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

    2. Add fields to the template. To this end, click the Add button.

    3. In the Field dialog displayed, fill in fields as it is shown in the following image. Once you are done, click OK.

    By clicking the Add button, add more fields with properties as shown in the following image:

    1. Switch to the XML tab to make adding patterns and rearranges to the input possible.

    2. In the input, add a pattern to the <Body_CustInvoiceTrans> element by using the Pattern tool available on the Developer toolbar.

    As a result, the pattern is added to each <Body_CustInvoiceTrans> element available in the input.

    1. Afterward, use the Rearrange tool available on the Developer toolbar to add rearranges to the following elements under the <Body_CustInvoiceTrans> one:

    • <ItemID>

    • <Name>

    • <Qty>

    • <SalesPrice>

    • <LineAmount>

    As you can see, rearranges are added under each <Body_CustInvoiceTrans> element available in the input.

    1. Edit a format for the rearrange added to the <Qty> element. To this end, double-click the rearrange.

    2. In the Edit XML Rearrange dialog displayed, switch to the Formats tab.

    3. From the Format category drop-down box, select Number. Once you are done, click Ok.

    1. Edit a format for the rearrange added to the <SalesPrice> and <LineAmount> elements. To this end, double-click each of them.

    2. In the Edit XML Rearrange dialog displayed, switch to the Formats tab.

    3. From the Format category drop-down box, select Number.

    4. Switch to the Output format tab, and then select the Override sheet output format checkbox.

    5. Click the Add button.

    6. In the dialog displayed, select XML Format from the Regional profile drop-down box, and then click Ok.

    Once you are done, click Ok in the Edit XML Rearrange dialog to confirm changes.

    1. In the output, right-click the <Lasernet> node, and then click Expand All on the context menu that appears.

    It is the right time to connect the pattern and rearranges you have added to the input with elements in the output. To this end, follow the steps listed below.

    1. In the input, double-click the pattern.

    2. In the Pattern Properties dialog displayed, switch to the Output tab.

    3. Select the ItemLine checkbox. Once you are done, click OK.

    Otherwise, you can drag the pattern (Body_CustInvoiceTrans) from the input to the <ItemLine> element in the output.

    1. In the input, double-click the first rearrange (ItemID).

    2. In the Edit XML Rearrange dialog displayed, switch to the XML tab.

    3. Select the ItemID checkbox. Once you are done, click Ok.

    Otherwise, you can drag the rearrange(ItemID) from the input to the <ItemID> element in the output.

    Afterwards, connect the rest of rearranges, one by one, in a sequence they are available in the input using any of the described options.

    1. You can now preview how your final document looks. To this end, click the Preview button on the toolbar. As a result, the final document opens in a separate window.

    You are now proposed to change the sheet options settings and see the difference of how the data is presented in the final document. To this end, follow these steps:

    1. On the Sheet menu, click Sheet Options.

    1. In the Sheet Options dialog displayed, switch to the CSV tab.

    2. Select a comma as a field separator. Once you are done, click Ok.

    1. To preview changes, click the Preview button on the toolbar.

    03.-CSV-Output
    49.13 KB


    What's Next
    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.