Print excel directly

Questions and answers on how to use XLSSpreadSheet.
Post Reply
MaxChan
Posts: 19
Joined: Sat Sep 03, 2016 6:38 am

Print excel directly

Post by MaxChan »

Hi,

Is there a way to print the sheet of TXLSSpreadSheet direct to printer?

Thank you very much!
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Print excel directly

Post by larsa »

Hello

Here is a sample:

Code: Select all

uses XLSBookPrint2;

var
  Print: TXLSBookPrint;
begin
  Print := TXLSBookPrint.Create(Nil);
  try
    Print.XSS := XSS;

    Print.FirstPage := 0;
    Print.LastPage := 2;

    Print.Print;
  finally
    Print.Free;
  end;
end;
Lars Arvidsson, Axolot Data
Post Reply