oops, first line must be onPrint event of the label
procedure TForm1.QRLabel1Print(sender: TObject; var Value: String);
Mike Littlewood
ASKER
Excellent thanks.
Mike Littlewood
ASKER
A quick add on to this question bokist.
This solution works fine on screen but when I send it to the printer the text does not seem to stay vertical. Have you had this issue too?
Unfortunately yes.
I have no explanation for this behaviour.
I find solution for this problem - little bit dirty - but it works.
Usually I have a button(btnReport) and two checkboxes(cbox_print, cbox_preview) on the main form.
In my solution I can print the report directly(without preview),
or I can have preview -
but then I can print the report only in second step(NOT FROM PREVIEW !) - clicking on btnReport when cbox_Print is checked.
Here is my solution:
procedure TForm1.btnReportClick(Sender: TObject);
var
Page_cnt : integer;
Report_file : string;
begin
Application.CreateForm(TForm2, Form2);
Report_file := 'c:\Reports\' + Form2.QuickRep1.ReportTitle + '.Qrp';
Form2.QuickRep1.Prepare;
Form2.QuickRep1.QRPrinter.Save(Report_file);
Page_cnt := Form2.QuickRep1.QRPrinter.PageCount;
if cbox_preview.checked then Form2.QuickRep1.Preview;
if cbox_print.checked then Form2.QuickRep1.QRPrinter.PrintMetafileDirect(Report_file,1,Page_cnt);
Form2.QuickRep1.Free;
Form2.Close;
end;
I hope the explanation is not too confused, and you can get it work.
Regards,
Steve
P.S. Excuse me on my poor English.
bokist
Almost forget - if you have better solution, please let me know.
Thanks
Mike Littlewood
ASKER
Ok thanks bokist, I'll let you know if I come up with something a bit more elegant, but in the mean time I will tailor the code you have provided.
Just to let you know bokist, I am about to purchase Quick Reports 5 Pro.
This has standard components to work with rotated labels.
Marwan Almukh
I have tried it into delphi 10.1 with quick report 6, not working, the result is like attached pictures.
1.png - the result of quick report.
2.png - the needed one.
procedure TForm1.QRLabel1Print(sende