Update position of textboxes positioned one on top of each other

Posted by: gerardo on 4 June 2024, 8:04 pm EST

    • Post Options:
    • Link

    Posted 4 June 2024, 8:04 pm EST

    Hi,

    as title says, in the Detail section of a Section report (code-based) lay 2 textboxes containing multiline text. The strategy followed is to change the position of the textbox at the bottom, so it is placed right where the first one ends.

    This was done in detail_Format event handler , the problem is the components return the default height (1 row height) at that time. I tried then to do this in the detail_BeforePrint event, the components have the correct height then, but setting the detail section height has no effect at that point, so there is a cut-off.

    how to acomplish this? basically hwo to stack N components on top of each other and make its position to “flow” when the components height change due to it’s respective contents.

    regards

  • Posted 5 June 2024, 5:55 am EST

    Hi Gerardo,

    You do not necessarily need to increase the height of your controls at runtime through code, you can place the two TextBox one above the other and set the ‘CanGrow’ property of your TextBox and Detail Section to ‘True’ and the TextBox placed above will automatically grow as per the number of lines of text placed within it and the next TextBox will start just below where the first one ends.

    Please find attached a sample implementing the same.

    Regards,

    Anand

    SampleReport.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels