Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delphi newbie help

Status
Not open for further replies.

Madmurg

Vendor
Nov 26, 2010
1
GB
I am new to delphi and i am struggling to print out an excel spreadsheet from a tXLSBookPrint component. It prints out ok but it prints too wide and it prints on 2 sheets of paper instead of 1.
here is my code if anyone can help.


procedure TForm1.Button2Click(Sender: TObject);
begin
if PrintDialog1.Execute then begin
XLSBookPrint1.XLS := XLSSpreadSheet1.XLS;
XLSBookPrint1.PrinterName := Printer.Printers[Printer.PrinterIndex];
if (PrintDialog1.FromPage > 0) and (PrintDialog1.ToPage > 0) then
XLSBookPrint1.Print(PrintDialog1.FromPage,PrintDialog1.ToPage)
else
XLSBookPrint1.Print;
end;
end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top