Move objects in report

MSCMSC
edited 11:22PM in FastReport Studio
Hi,

i want to move objects before printing a report.
I tried out with the TOP property of the object like a label.

I ve taken the before print property. The result is that the label is positioned near the top line. That is not the desired position.

Here the code:

procedure Pag1OnBeforePrint(Sender: TfrxComponent);
begin
if Engine.FinalPass then
BEGIN
if Edit1.text = 'TEST' then
Edit1.top:= 10;
END;
END;

Have you an idea how to use it correct ?

Comments

  • edited 11:22PM
    Hi,

    Hope I have understood you clearly. top:=10, is actually near the top. So you can try to use a bigger number instead of 10.Try maybe 20 or 30 and see where it takes you.
  • MSCMSC
    edited 11:22PM
    HERBERTS wrote: »
    Hi,

    Hope I have understood you clearly. top:=10, is actually near the top. So you can try to use a bigger number instead of 10.Try maybe 20 or 30 and see where it takes you.

    Hi,

    you have understood right: the top property need to have a higher value. In this case 450. But i don't understand the reason: in the object inspector is a value of 6.8 in the top property of the object placed in the middle of the report. Now, i have to use much higher values.

    Why ?

    regards
  • edited 11:22PM
    Hi,
    wrote:
    In this case 450. But i don't understand the reason: in the object inspector is a value of 6.8 in the top property of the object placed in the middle of the report. Now, i have to use much higher values.
    Why ?
    450 - value in pixels.
    6.8 - value in centimeters.
    The object inspector shows value in centimeters.
    Script uses values in pixels. Use following code to set value in centimeters from script:
    Edit1.Top := 10 * fr1cm;
    

Leave a Comment