Hi all,
Is it possible in TM1 to export data in XML format like we export as CSV ??
Eport as XML
-
- Posts: 5
- Joined: Tue Sep 13, 2011 7:49 am
- OLAP Product: Oracle 10 g
- Version: 9.5.1
- Excel Version: 2007
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: Eport as XML
No, not natively. You would have to write your own code in TI to create the XML tags and use them in the TextOutput function.
-
- Posts: 5
- Joined: Tue Sep 13, 2011 7:49 am
- OLAP Product: Oracle 10 g
- Version: 9.5.1
- Excel Version: 2007
Re: Eport as XML
Thanks tomok.
Can i get a sample code or link where i can learn about it in detail. That would be great.
Can i get a sample code or link where i can learn about it in detail. That would be great.
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: Eport as XML
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.
-
- MVP
- Posts: 733
- Joined: Wed May 14, 2008 11:06 pm
Re: Eport as XML
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 );
Robin Mackenzie
-
- Community Contributor
- Posts: 109
- Joined: Thu Feb 26, 2009 8:44 am
- OLAP Product: TM1
- Version: 9 + 10 + Plan An
- Excel Version: All
- Location: Isle of Wight, UK
Re: Eport as XML
Blessings upon rmackenzie for one of the most time-saving and useful snippets of code hertofore posted herein.
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 );
"the earth is but one country, and mankind its citizens" - Baha'u'llah