Connect to XML data source

The XML data source in the Bold Reports® Web Report Designer retrieves data from an XML file, a string in XML format, or an external URL so you can use it in reports.

How do I create an XML data source?

You create an XML data source from the Data panel of the Bold Reports® Web Report Designer. Follow these steps:

  1. Click the Data icon in the configuration panel. Data icon configuration panel
  2. In the DATA configuration panel, click the NEW DATA button. New Data Panel
  3. In the connection type panel, choose the XML data source type. Connection types panel
  4. Specify the data source name without special characters in the Name field. XML datasource properties

Which XML source types can I use?

The Bold Reports® XML data source connects to XML data using the following three options:

  • Inline - Inline data.
  • File Path - Load from disk.
  • External - Load from external URL.

Source types

How do I use inline XML data?

You use inline XML data by pasting an XML string into the Inline text area of the XML data source.

  1. Choose Inline in the Type drop-down.

  2. Specify a string that contains XML data in the Inline text area.

    <?xml version="1.0" encoding="UTF-8"?>
    <root>
       <element>
          <FirstName>First Name 1</FirstName>
          <ID>1</ID>
          <IDBook>1</IDBook>
          <LastName>Last Name 1</LastName>
       </element>
       <element>
          <FirstName>First Name 2</FirstName>
          <ID>2</ID>
          <IDBook>1</IDBook>
          <LastName>Last Name 2</LastName>
       </element>
    </root>
    
  3. Click Connect to open the query design pane. The left pane of the query design pane shows the structure of the XML data. Left schema

  4. Drag the table from the left pane to the query design view and execute it. New connection panel

  5. Click Finish to save the data source with a relevant name and continue designing the report. New connection panel

How do I load XML data from disk?

You load XML data from disk by choosing the File type and uploading an XML file to the Web Report Designer.

  1. Choose the File option in the Type field. The upload option appears, as shown below. New connection panel
  2. Click the three-dotted button to open the upload box. Browse to the XML file and click open. New connection panel
  3. Click Connect to open the query design pane. New connection panel
  4. Review the left pane of the query design pane, which shows the structure of the XML data. Left schema
  5. Drag the table from the left pane to the query design view and execute it. New connection panel
  6. Click Finish to save the data source with a relevant name and continue designing the report. New connection panel

How do I load XML data from an external URL?

You load XML data from an external URL by choosing the External type and entering the URL in the XML data source.

  1. Choose the External option in the Type field. New connection panel
  2. Specify an external URL in the External text area. New connection panel
  3. Click Connect to open the query design pane. The left pane of the query design pane shows the structure of the XML data.
  4. Drag the table from the left pane to the query design view and execute it. New connection panel
  5. Click Finish to save the data source with a relevant name and continue designing the report. New connection panel

Note:

  • In schema tree, the nested fields in the XML data will be shown as flat structure.
  • When the XML data contains duplicate key names at different levels, Bold Reports® ensures uniqueness and avoids conflicts by appending the parent keys to each field name using the following format: <fieldName>__<topLevelParentKey>_<nextParentKey>_..._<immediateParentKey>_.

Frequently asked questions

How are nested XML fields shown in the schema tree?

The Bold Reports® Web Report Designer shows nested fields in the XML data as a flat structure in the schema tree.

What happens when XML data has duplicate key names?

Bold Reports® appends the parent keys to each field name to keep names unique and avoid conflicts.

See also

Formatting Columns

Dataset Parameter

Connect to a Snowflake data source