Link to home
Start Free TrialLog in
Avatar of wimmeyvaert
wimmeyvaert

asked on

Setting Pen-Width of a TQRShape (Quick Reports)

Hi Experts,

I'm making a report which contains several
TQRShape-components.
There are shapes with different styles :
- qrsRectangle
- qrsVertLine
- qrsHorLine

Now I want to set the Width of the border of thos TQRShapes to different values.

All this works as long as i only Preview the report.
When I really print it, then the borders of those
shapes are all alike (very thin).

What do I have to do to print the borders of some shapes thick and other thin ?

Best regards,
The Mayor
Avatar of Cesario Lababidi
Cesario Lababidi
Flag of Germany image

Hello wimmeyvaert,

There is a known problem where the thickness of the Shape's lines vary between the preview and the printer.  The work around is to set the Shape.Pen.Width property to a variable and set the value depending on whether you are printing or previewing.  In the report's BeforePrint event, you can check the value of the report's QRPrinter.Destination property.  If it's set to qrdMetafile, then it's rendering the preview.  If it's set to qrdPrinter, then it's rendering the report directly to the printer.

Best Regards

Cesario
Avatar of wimmeyvaert
wimmeyvaert

ASKER

Hi Cesario,

I tried your suggestion, but I fail to compile the following code :

procedure TqrOdetteLabel.QuickRepBeforePrint(Sender: TCustomQuickRep;
  var PrintReport: Boolean);
begin
  if QRPrinter.Destination = qrdMetaFile then
    qrchpBorder.Pen.Width := 10;
end;

It has something to do with 'qrdMetaFile' (incompatible types).
Can you help me any further with the code ?

Thanx,
The Mayor
Dear expert(s),

A request has been made to close this Q in CS:
https://www.experts-exchange.com/questions/20461282/Can-you-delete-these-questions-for-me-please.html

Without a response in 72 hrs, a moderator will finalize this question by:

 - Saving this Q as a PAQ and refunding the points to the questionner

When you agree or disagree, please add a comment here.

Thank you.

modulo

Community Support Moderator
Experts Exchange
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial