Avatar of Mike Littlewood
Mike Littlewood
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Can a quick report label be printed with vertical text easily?

I am trying to print some text in a TQRLabel vertically. Does anyone have an example of this?
Delphi

Avatar of undefined
Last Comment
Marwan Almukh

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
bokist

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
bokist

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?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
bokist

Hi mike!

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.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Mike Littlewood

ASKER
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.the resultthe needed