Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to export two charts in one xml file?

Hi,

I have a problem how to export two charts consecutively in one xml file. I also need to modify some of the tags. I have managed to export those two charts individually. Below are examples for charts how they look right now in xml format. In the first chart I need to remove chart description tag "StraightTableBox" and modify tag's "numberOfOrders" text. I should also add the opening and closing tags for for both of the charts. From chart number two I also need to remove chart description tag "TableBox" and modify tag's "<row>" text. I posted also the macro I used and the desired xml format. How should I modify macro to get desired modifications?

Chart number one:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<StraightTableBox>

<numberOfOrders>

  <ID>100</D>

  <Name>XXX</Name>

  <totalSales>1000.00</totalSales>

</numberOfOrders>

</StraightTableBox>

Chart number two:

<TableBox>

<row>

  <Id>100</Id>

  <Title>XXX</Title>

  <Amount>10.0</Amount>

</row>

<row>

  <Id>100</Id>

  <Title>XXX</Title>

  <Amount>10.0</Amount>

</row>

</TableBox>

Desired xml format:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<Title>

<Total>

  <ID>100</D>

  <Name>XXX</Name>

  <totalSales>1000.00</totalSales>

</Total>

<subtitle>

<row>

  <Id>100</Id>

  <Title>XXX</Title>

  <Amount>10.0</Amount>

</row>

<row>

  <Id>100</Id>

  <Title>XXX</Title>

  <Amount>10.0</Amount>

</row>

<subtitle>

</Title>

Current macro:

SUB ExportHeader

SET Table = ActiveDocument.GetSheetObject("CH01")

Table.ExportXml "C:\QV\Xml\test.XML"

END SUB

SUB ExportOrders

SET Table2 = ActiveDocument.GetSheetObject("TB01")

Table2.ExportXml "C:\QV\Xml\test2.XML"

END SUB

0 Replies