locked
'CanGrow' set to YES but textbox and/or report header not expanding to fit string. RRS feed

  • Question

  • I have a textbox inside a report header. Both the report header and the textbox have CanGrow set to YES.

    When I move a large string into the textbox, it gets truncated. I don't see the entire string.

    If I modify the report to make the textbox and the report header bigger (without changing any code), then I see the full string in the textbox.

    Anyone got any idea why the CanGrow properties are not working?

    PS: This is the report event where I populate the textbox if it makes a difference:

    Private Sub ReportHeader_Print(Cancel As Integer, PrintCount As Integer)

    Tuesday, May 16, 2017 1:07 AM

Answers

  • I found the answer!

    The string has to be moved into the textbox in the report header in this event:

    Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)

    The ReportHeader_Print event works fine so long as the 'Can Grow' is not triggered, so I assume the 'Can Grow' has to happen when formatting rather than when printing.

    Phew! That one cost me about half a day.

    Tuesday, May 16, 2017 1:18 AM