Skip to main content

CSV Output - Knowledgebase / Lasernet / Lasernet Training / Lasernet Form Editor 9 - XHTML, CSV, EDI, XML, JSON, PDF Form (filled) Output - Formpipe Support Portal

CSV Output

Authors list

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. Afterwards, go 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 on the picture below. Once you are done, click OK.

By clicking the Add button add more fields with properties as it is shown on the picture below:

4. Switch to the XHTML tab to make adding patterns and rearranges to the input possible.

5. 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.

6. Afterwards, 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.

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

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

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

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

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

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

13. Switch to the Output format tab, and then select the Override sheet output format check box.

14. Click the Add button.

15. 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.

16. 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.

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

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

19. Select the ItemLine check box. Once you are done, click OK.

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

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

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

22. Select the ItemID check box. 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.

23. 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 the steps listed below:

24. On the Sheet menu, click Sheet Options.

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

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

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

Helpful Unhelpful

Add a comment

Please log in or register to submit a comment.

Need a password reminder?

Share