Changing control height at run time in page report

Posted by: kev on 13 May 2021, 9:44 pm EST

  • Posted 13 May 2021, 9:44 pm EST

    I'm using AR14, but could upgrade the project to 15 if it helps.

    My report is for an invoice. I have a fixed size area on the front page of the report for invoice line details. This is implemented using a BandedList control, with each row containing fields for the line description, amounts, etc. The problem I'm having is that the invoice line descriptions can cover a variable number of lines of text, but I don't seem to be able to find any way to size the text box and the banded list row that contains it to ensure that the right amount of vertical space is used to show the content. I've tried using a large initial height and setting ShrinkToFit to true on the TextBox and CanShrink on the containing BandedList_Details control, but the settings are ignored and the fixed height is always used. I've also tried providing a script function to set the height, but I'm not sure what is should return or if it will work (at the moment I always get the error:

    Invalid expression.  Literal expressions for this property must be of type 'length.'  Valid units are 'cm', 'mm', 'in', 'pt', and 'pc'.

    I'm not sure how to return a 'length', or even if I can (setting my function return type to 'length' or 'Length' still gives the same error)

    Any suggestions?
  • Replied 14 May 2021, 1:22 am EST

    Hello Kev,

    Can you use the RDL report instead of the PageReport to achieve your requirement?

  • Replied 16 May 2021, 11:49 pm EST

    I'd have to take a look. We are using a number of features of the page report, including two data sets streaming into different parts of the first fixed page, and the overflow feature to continue excess items to different areas on subsequent pages. Most immediate issue would be converting a reasonably complex report to a new format

    I'm guessing from your response this can't be done. I've realised since posting that ShrinkToFit does something else entirely, which isn't much use for our application. Perhaps I can work around this by splitting multi-line items into individual lines (not entirely trivial when you take wrapping into account) and converting the amount columns to strings with empty entries on everything but the first row. I'm a little surprised there isn't support for this - it doesn't seem too unusual a requirement?
  • Replied 17 May 2021, 3:07 pm EST


    PageReport is fixed layout report type where none of the report controls can grow or shrink at run time. For data region control(Like Table, BandelList), you have to set the fixed size of the control so that it can render on the page as our design and overflow on the next page if does not fit into one page.
    Hence, size of control can't be changed at runtime as per their content.

    RDL and Page Report, have same control, almost same feature with different layout design. In RDL Report, control can grow or shrink as per the content. You can set the CanGrow or CanShrink property of the TextBox to achieve your requirement.

    Please let me know if you have any other question.

  • Replied 17 May 2021, 6:47 pm EST

    As I understand it, an RDL report doesn't allow me to use the overflow feature. The invoice report I'm working with has two sections on the front page, each fed by a different collection of data. Each section is a fixed size and if it overflows then extra data is fed into a differently shaped (larger and different position) area on the second page. Can I still do that with an RDL report

    With regards to your comment about the fixed size of data region controls, I get that, and indeed that's what I want - the BandedList needs to remain a fixed size. However, we're talking about the content items of the banded list, not the list itself
  • Replied 18 May 2021, 5:10 pm EST


    >>Can I still do that with an RDL report
    Can you share the report with me and output pdf so that I can try at my end.

    >>However, we're talking about the content items of the banded list, not the list itself
    Sorry for the confusion, all control like TextBox, Container etc does not increase or decrease its size as per content in the PageReport.

    Also, as workaround, you can use rdl report as sub report in the PageReport to show the content. Please refer to the attached report.

Need extra support?

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

Learn More

Forum Channels