Move objects in report

MSCMSC
edited 7:54PM 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 7:54PM
    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 7:54PM
    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 7:54PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.