Eport as XML
Posted: Fri Sep 16, 2011 11:09 am
Hi all,
Is it possible in TM1 to export data in XML format like we export as CSV ??
Is it possible in TM1 to export data in XML format like we export as CSV ??
Discussing all things TM1, Planning Analytics, PAx and PAW
https://www.tm1forum.com/
There isn't any that I know of. That's why I said you would have to write your own.Venkat1688 wrote:Thanks tomok.
Can i get a sample code or link where i can learn about it in detail. That would be great.
Code: Select all
# set empty string as quote char
DatasourceASCIIQuoteCharacter = '';
# set filename
sFileName = 'test.xml';
# header
sXml = '<?xml version="1.0" encoding="UTF-8"?>';
AsciiOutput ( sFileName, sXml );
# open root
sXml = '<root>';
AsciiOutput ( sFileName, sXml );
# open branch
sXml = '<branch>';
AsciiOutput ( sFileName, sXml );
# populate some leaf information
nCounter = 1;
nMaxLeaves = 10;
WHILE ( nCounter <= nMaxLeaves );
# open leaf
sXml = '<leaf';
sXml = sXml | ' name="' | NumberToString ( nCounter ) | '"';
sXml = sXml | ' type="example">';
# close leaf
sXml = sXml | '</leaf>';
# output
AsciiOutput ( sFileName, sXml );
nCounter = nCounter + 1;
END;
# close branch
sXml = '</branch>';
AsciiOutput ( sFileName, sXml );
# close root
sXml = '</root>';
AsciiOutput ( sFileName, sXml );
rmackenzie wrote:Code: Select all
# set empty string as quote char DatasourceASCIIQuoteCharacter = ''; # set filename sFileName = 'test.xml'; # header sXml = '<?xml version="1.0" encoding="UTF-8"?>'; AsciiOutput ( sFileName, sXml ); # open root sXml = '<root>'; AsciiOutput ( sFileName, sXml ); # open branch sXml = '<branch>'; AsciiOutput ( sFileName, sXml ); # populate some leaf information nCounter = 1; nMaxLeaves = 10; WHILE ( nCounter <= nMaxLeaves ); # open leaf sXml = '<leaf'; sXml = sXml | ' name="' | NumberToString ( nCounter ) | '"'; sXml = sXml | ' type="example">'; # close leaf sXml = sXml | '</leaf>'; # output AsciiOutput ( sFileName, sXml ); nCounter = nCounter + 1; END; # close branch sXml = '</branch>'; AsciiOutput ( sFileName, sXml ); # close root sXml = '</root>'; AsciiOutput ( sFileName, sXml );