The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



SaveAsXMLFile


Unit:SDL_replist
Class:TReportListView
Declaration: procedure SaveAsXMLFile (FName: string; DataID: string);

The method SaveAsXMLFile stores the contents of the report listview as an XML file on the disk. The parameter FName specifies the name of the file to be generated, the parameter DataID holds a unique identifier which is stored as the attribute "id " of the <replist> tag. If the parameter DataID is empty, the value of the property DataID is used instead of an empty string. For a detailed description of the generated tags please see the method WriteToOpenXMLFile.

Please note that the data of the report listview is stored using the current sort order. Thus it is recommended to perform an UnSort before saving the data.

Example: Following is a sample XML code generated by SaveAsXMLFile. The parameter DataID has been set to 'TestRepList':

<?xml version="1.0"?>
<!-- TReportListView / SDL Component Suite -->
<replist sig="SDLCSuite" vers="1.0" id="TestRepList">
<numcols>4</numcols>
<numrows>13</numrows>
<colname ix="1">Cust.No.</colname>
<colname ix="2">First Name</colname>
<colname ix="3">Last Name</colname>
<colname ix="4">Address</colname>
<columnformat ix="1">[i][120]0001</columnformat>
<checkedcolumn ix="2" />
<checkedcolumn ix="3" />
<cell ix="1" iy="1">1</cell>
<cell ix="3" iy="1">Hayek</cell>
<cell ix="1" iy="2">2</cell>
<cell ix="2" iy="2"checked=""></cell>
<cell ix="3" iy="2">Miller</cell>
<cell ix="1" iy="3">3</cell>
<cell ix="3" iy="3">Arsenna</cell>
<cell ix="4" iy="3">Richmond, California</cell>
<cell ix="1" iy="5">5</cell>
<cell ix="2" iy="5">Jack</cell>
<cell ix="1" iy="6">6</cell>
<cell ix="1" iy="8">8</cell>
<cell ix="2" iy="8">Sally</cell>
<cell ix="3" iy="8" checked="">Horvath</cell>
<cell ix="1" iy="9">9</cell>
<cell ix="3" iy="9" checked="">Stewart</cell>
<cell ix="4" iy="9">Cape Town, RSA</cell>
<cell ix="1" iy="10">10</cell>
<cell ix="2" iy="10">Morgan</cell>
<cell ix="3" iy="10" checked="">Maltese</cell>
<cell ix="1" iy="13">13</cell>
<cell ix="2" iy="13">Dave</cell>
<cell ix="4" iy="13">Taipei, Taiwan</cell>
</replist>

Example: This method is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): replistv



Last Update: 2013-Mar-24