SSExportRangeToXMLBuffer Function
Applies To
fpSpread control
Description
Exports the specified range of cells in XML format and stores the information in a buffer.
Syntax
BOOL SSExportRangeToXMLBuffer (HWND hWnd, SS_COORD lCol, SS_COORD lRow, SS_COORD lCol2, SS_COORD lRow2, LPCTSTR pszRoot, LPCTSTR pszCollection, HGLOBAL *hgBuff, long lFlags, LPCTSTR lpszLogFile);
BOOL TSpread::ExportRangeToXMLBuffer (SS_COORD lCol, SS_COORD lRow, SS_COORD lCol2, SS_COORD lRow2, LPCTSTR pszRoot, LPCTSTR pszCollection, HGLOBAL *hgBuff, long lFlags, LPCTSTR lpszLogFile);
Parameters
The following parameters are available:
Parameter | Description | |
---|---|---|
lCol | Column number of first column in range to export | |
lRow | Row number of first row in range to export | |
lCol2 | Column number of last column in range to export | |
lRow2 | Row number of last row in range to export | |
pszRoot | Root element to use in the XML file Do not use spaces in this string. |
|
pszCollection | Collection element to use in the XML file Do not use spaces in this string. |
|
hgBuff | Returns the handle to the buffer | |
lFlags | Whether to export formatted or unformatted data Use one of the following values: |
|
Constant | Description | |
SS_EXPORTXML_FORMATTED | To export data as formatted data | |
SS_EXPORTXML_UNFORMATTED | To export data as unformatted data | |
lpszLogFile | Path and file name of log file to create If you do not provide a file name, the export will not create a log file. If you do not want to create a log file, set this parameter to NULL. |
Remarks
This function is applied to the current sheet setting unless you first call the SSSetSheet function to specify the sheet for which you are calling this function.
Call this function to export a range of cells from a sheet to XML data in a buffer. The export creates XML data that provides the sheet data as a set of tagged XML elements. The XML data created conforms to XML 1.0 guidelines.
Use the Root and Collection parameters to specify the root node necessary for valid XML data. The export uses the column headers in the sheet as the child elements within each collection element. If you provide custom text for the column headers, do not use spaces in the text; XML tags cannot contain spaces. If the sheet does not contain text in the column headers, the child element tags in the XML file default to <A>, <B>, <C>, and so forth. The export ignores any row headers.
Use the lFlags parameter to specify whether formatted or unformatted data is saved to the XML file. For more information about formatted and unformatted data, see Formatted and Unformatted Data.
Once you save a sheet by calling this function, you can call the SSLoadFromBuffer function to load the sheet into the fpSpread control. Pass the hgBuff from the SSExportRangeToXMLBuffer function to the SSLoadFromBuffer function.
Tip: You might want to save your sheet as a Spread (.SS8) file in addition to saving it as XML data in a buffer so that you can open the Spread (.SS8) file for future modifications. |
The following table summarizes the formats to which you can save data:
To Save To . . . | Use Function |
---|---|
Binary file (proprietary format) | SSSaveToFile |
Tab-delimited file | SSSaveTabFile or SSSaveTabFileU |
Delimited file (offers user-defined delimiters) | SSExportToTextFile or SSExportRangeToTextFile or SSExportToTextFileU or SSExportRangeToTextFileU |
Excel-formatted file | SSExportExcelBook or SSExportToExcel |
HTML file | SSExportToHTML or SSExportRangeToHTML |
XML file | SSExportToXML or SSExportRangeToXML |
XML buffer | SSExportToXMLBuffer or SSExportRangeToXMLBuffer |
An array | SSGetArray |
For instructions and more information about saving data to a buffer, see Saving to a Buffer. For more information about XML export, see XML File Export (online PDF manual). XML File Export lists and describes the method in which Spread property settings are interpreted in the XML data.
Return Type
True if the function completes successfully; False otherwise.
See Also
Saving to a Buffer
XML File Export (online PDF manual)
SSExportToXMLBuffer, SSLoadFromBuffer, SSSetSheet functions
ActiveX Correspondence
ExportRangeToXMLBuffer method