Table of Contents

TFlexCelWriter Record

Encapsulates a generic writer. This record converts automatically from a TStreamWriter or a TFlexCelStreamWriter, so you can use both when a FlexCel method requires a TFlexCelWriter.

Syntax

Unit: FlexCel.Core

TFlexCelWriter = record;

Operators

Examples

To use a method that takes a TFlexCelWriter as parameter with a standard Delphi TStreamWriter you would use:

procedure ExportToHtmlWitFlexCelWriter(const xls: TExcelFile);
var
  Writer: TStreamWriter;
  html: TFlexCelHtmlExport;
begin
  Writer := TStreamWriter.Create('myfilename.txt');
  try
    html := TFlexCelHtmlExport.Create(xls, true);
    try
      // Note that the method expects a TFlexCelWriter,
      // but we can pass a TStreamWriter directly.
      html.Export(Writer, 'result.html', nil);
    finally
      html.Free;
    end;
  finally
    Writer.Free;
  end;