Saturday, October 11, 2008  



 FarPoint Technologies
 (800) 645-5913

 fpsales@fpoint.com



     
 »Spread »Product Tour » Saving Data

Previous Saving Data Next

You can save data from the fpSpread control into many different file formats. Also, depending on how you want to save the data, you might have a choice to save the data only, or to save the data and formatting.

Save to a Spread File | Save to a Text File | Save to a Buffer | Save Data to an Array | Export to an HTML File | Export to an XML File | Export to an Excel-Formatted File

  Back to Top
 Save to a Spread File
   Binary files, or Spread files, are in a proprietary format that the fpSpread control or the Spread Designer can read. You can save the spreadsheet's data and formatting or save only the spreadsheet's data to a Spread file.

The following example saves data to a Spread file.

ret = fpSpread1.SaveToFile("C:\DATA.SS2", False)


  Back to Top
 Save to a Text File
   You can save the entire spreadsheet or a portion of the spreadsheet data from the fpSpread control to tab-delimited, comma-delimited files, or many other delimited files.

The following example saves the spreadsheet data to a tab-delimited file.

ret = fpSpread1.SaveTabFile("C:\DATA.TB3")

 Back to Top
 Save to a Buffer
   You can save a spreadsheet data or its data and formatting to a buffer with the following options:
- Save the data as XML data in a buffer
- Save a portion of the data as XML data in a buffer
- Save the data as text in a buffer

Call fpSpread1.ExportToXMLBuffer("Root", "Collection", Buffer, ExportToXMLUnFormattedData, "")
 

  Back to Top
 Save Data to an Array
   You can save spreadsheet data to an array.

If you are using the ActiveX control, you can declare the array as a string, integer, long, byte, single, double, or variant. If you are using the DLL control, the array type can be short, long, float, double, or int.

The following example returns an array consisting of a 3×3 block of cells starting at cell A1

Dim myarray(2, 2)
ret = fpSpread1.GetArray(1, 1, myarray)

  Back to Top
 Export to an HTML File
   You can export a cell, a block of cells, a column, a row, or the entire spreadsheet to an HTML file. Graphics can also be exported.

The following example exports the contents to an HTML file and creates the export log file.

x = fpSpread1.ExportToHTML("C:\SPREAD.HTML", False, "C:\LOGFILE.TXT")


  Back to Top
 Export to an XML File
   You can export a spreadsheet or a range of data from a spreadsheet to an XML file. The exported XML file provides the spreadsheet data as a set of tagged XML elements, which conforms to XML 1.0 guidelines.

The following example exports the contents to an XML file and creates the export log file.

ret = fpSpread1.ExportToXML("C:\Spread.xml", "root_element", "collection_element", ExportToXMLFormattedData, "c:\spread.log")
<root_element>
 <collection_element>
  <A>col1_row1_data</A>
  <B>col2_row1_data</B>
  <C>col3_row1_data</C>
 </collection_element>
 <collection_element>
  <A>col1_row2_data</A>
  <B>col2_row2_data</B>
  <C>col3_row2_data</C>
 </collection_element>
</root_element>

  Back to Top
 Export to an Excel-Formatted File
   You can export a spreadsheet to the Microsoft Excel 97, Excel 2000, and Excel 2002 format (BIFF8).

The following example exports a Spread sheet as an Excel spreadsheet and creates the export log file.

x = fpSpread1.ExportToExcel("C:\FILE.XLS", "Sheet 1", "C:\LOGFILE.TXT")


Previous Saving Data Next


    
 Have a question?
Have a Question? Ask Us!
Subscribe to the RSS feed!RSS Subscribe
 

 
Learn about the new Roadshow now!


Developer Tour
Adding Data
Saving Data
Working with Data
Working with Spreadsheets
Printing Spreadsheets
Customizing Columns and Rows
Working with Cells
Working with Cell Types
Binding to Databases
Customizing the Spreadsheet Display
Customizing User Interaction
Spread Designer Overview
50 Spread Events
Rate Tour

Copyright © 1991-2007 FarPoint Technologies, Inc. All rights reserved. All names are property of their respective owners.