Spread 8.0 Documentation
ExportToXMLBuffer, ScriptExportToXMLBuffer Methods
Support Options
ActiveX Reference > ActiveX Methods > ExportToXMLBuffer, ScriptExportToXMLBuffer Methods

Glossary Item Box

ExportToXMLBuffer, ScriptExportToXMLBuffer Methods


See Also    DLL    Example

Applies To

fpSpread control

Description

Saves the sheet in XML format and stores the information in a buffer.

Syntax

C++

BOOL CSpreadSheet::ExportToXMLBuffer(LPCTSTR Root, LPCTSTR Collection, BSTR* Buff, long Flags, LPCTSTR LogFile);

Visual Basic

fpSpread1.ExportToXMLBuffer(ByVal Root As String, ByVal Collection As String, Buff As String, ByVal Flags As ExportToXMLConstants, ByVal LogFile As String) As Boolean

Note: The ScriptExportToXMLBuffer method uses the same syntax except method parameters that are not passed "ByVal" are declared as variants. For more information on Script methods, see Scripting Environment Usage.

Parameters

The following parameters are available:

Parameter Description
Root Root element to use in the XML file
Do not use spaces in this string.
Collection Collection element to use in the XML file
Do not use spaces in this string.
Buff Returns the handle to the buffer
Flags Whether to export formatted or unformatted data
Use one of the following values:
Constant Value Description
ExportToXMLFormattedData 0 To export data as formatted data
ExportToXMLUnFormattedData 1 To export data as unformatted data
LogFile 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 "".

Remarks

Use this method to export 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.

This method is called for the current sheet setting unless you first set the Sheet property to specify the sheet with which you want to work.

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 Flags 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.

The following table summarizes the formats to which you can save data from a workbook or sheet:

To Save To . . . Use Method
Binary file (proprietary format) SaveToFile
Tab-delimited file SaveTabFile or SaveTabFileU
Delimited file (offers user-defined delimiters) ExportToTextFile or ExportRangeToTextFile
or ExportToTextFileU or ExportRangeToTextFileU
Excel-formatted file ExportExcelBook or ExportToExcel
HTML file ExportToHTML or ExportRangeToHTML
XML file ExportToXML or ExportRangeToXML
XML buffer ExportToXMLBuffer or ExportRangeToXMLBuffer
An array GetArray

Note: Call this method if you use the Spread control in a scripting environment (for example, Microsoft's Visual InterDev or Internet Explorer) or a non-scripting environment. However, if you want to use the Spread control in a scripting environment and you want to change any parameter that is not passed "ByVal", you must set the ScriptEnhanced property to True and call the ScriptExportToXMLBuffer method. ScriptExportToXMLBuffer method parameters that are not passed "ByVal" are declared as variants.

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 successful; otherwise, False.

See Also

Saving to a Buffer
XML File Export (online PDF manual)

ScriptEnhanced, Sheet properties

ExportRangeToXML, ExportRangeToXMLBuffer, ExportToXML methods

DLL Correspondence

SSExportToXMLBuffer function

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.