Printing

Hello Adrian,

I see in forum, that Flexcel 5.2 have no printing methods but it's come with the new version.
Today, it the 5.6.5, i would like to know if you have implementing printing methods or how can i print Excelfile ?

Thanks you for you answer.

Best regards
Gilles

Hi,


Yes, you can print using a TFlexCelPrintDocument object:

procedure Print;
var
  p: TFlexCelPrintDocument;
  xls: TExcelFile;
begin
  xls := TXlsFile.Create( 'c:\file.xlsx');  
  try
     p := TFlexCelPrintDocument.Create(xls);
     try
        p.Print;
      finally
         p.Free;
       end;
    finally
       xls.Free;
    end;
end;

You can also see a demo on how to print at:
\Demo\Delphi\Modules\25.Printing and Exporting\20.CustomPreview

Note: Printing is only available for VCL, not FireMonkey.

Regards,
    Adrian.

Thanks Adrian,

it's work fine.

Regards
Gilles