Skip to main content

TdxCustomSpreadSheet.SaveToStream(TStream,TdxSpreadSheetCustomFormatClass) Method

Saves workbook data and concomitant settings to a stream.

Declaration

procedure SaveToStream(AStream: TStream; AFormat: TdxSpreadSheetCustomFormatClass = nil); virtual;

Parameters

Name Type
AStream TStream
AFormat TdxSpreadSheetCustomFormatClass

Remarks

Call this procedure to save workbook data and settings to a stream (an instance of the TStream descendant) passed as the AStream parameter. The information saved to the specified stream, can include (depending on its internal data format):

The SaveToFile procedure calls the SaveToStream procedure to save a spreadsheet document to a file stream. Calling this procedure raises the OnProgress event multiple times on reaching certain inner marks dependant on the stream data format, allowing you to track the saving progress.

The optional AFormat parameter of the SaveToStream procedure allows you to specify a custom stream object format class. For instance, if you need to save CSV to a stream, specify the class reference to an object corresponding to the CSV format explicitly:

var
  AStream: TMemoryStream;
//...
  dxSpreadSheet1.SaveToStream(AStream, TdxSpreadSheetCSVFormat);

Note

The CSV file format settings applied to all Save/Load operations can be customized by calling the dxSpreadSheetCSVFormatSettings function declared in the dxSpreadSheetFormatCSV unit.

See Also