Manually align object

johnnixjohnnix Serrai, Greece
edited 6:59AM in FastReport 4.0
Hello,

I wish to manually align a TfrxMemoView inside a page by code (I don't want to use the Align property). On the OnBeforePrint event of the MemoView I have the code:

MemoView1.Left := Page1.PaperWidth - Page1.RightMargin - MemoView1.Width;

but it does not place the object in the position I want, far to the right of the page. Any help would be mostly appreciated.

Kindest regards

Comments

  • edited 6:59AM
    johnnix wrote: »
    Hello,

    I wish to manually align a TfrxMemoView inside a page by code (I don't want to use the Align property). On the OnBeforePrint event of the MemoView I have the code:

    MemoView1.Left := Page1.PaperWidth - Page1.RightMargin - MemoView1.Width;

    but it does not place the object in the position I want, far to the right of the page. Any help would be mostly appreciated.

    Kindest regards

    I think you should put your code in an obp-event above the actual component. This might be in a band (if banded) og maybe the page.

    Petter
  • edited 6:59AM
    gavind wrote: »
    Tried it but still no luck. Any ideas out there please?

    Take a look at the attached report. The second memo is a moved by code.

    I also think there are some conversion-issues in your code. The paperwidth and rigthmargin must be converted from mm to pixels:

    MemoView1.Left := ((Page1.PaperWidth - Page1.RightMargin) * fr01cm) - MemoView1.Width;

    Petter

Leave a Comment