FlexReport Designer OnFormat script to show/hide subsections

Posted by: mitchb on 8 January 2018, 2:55 pm EST

    • Post Options:
    • Link

    Posted 8 January 2018, 2:55 pm EST

    My report has two detail subsections DetailA, DetailB, together taking the height of the page.

    When DetailB is hidden, I want to increase or autogrow the height of DetailA; when DetailB is show, decrease DetailA height.

    Something like this is working for the visibility of DetailB, but not for the change in height of DetailA

    If [Page] = 1 Then

    Detail.SubSections(1).Visible = False

    Detail.SubSections(0).Height = 15000

    Else

    Detail.SubSections(1).Visible = True

    Detail.SubSections(0).Height = 10410

    EndIf

    I have autogrow turned on.

    Also, I have anchors set so that the vertical lines that are drawn in DetailA will resize according to the size of the subsection. But this is not working either.

    I’ve been search this forum for help but everything of interest gives me a 404 not found error, bad link.

  • Posted 9 January 2018, 1:12 am EST

    Hi,

    I escalated your issue to concern team. Will let you know as soon as there is any information from then.

    (TFS ID: 304403 for internal use only)

    Related to web issue:

    Our web team is working on the same and hope, it will be fixed in future.

    Thanks,

    Singh

  • Posted 5 February 2018, 5:46 am EST

    Hi,

    As per the developer, OnFormat is fired for each section prior to its printing. When it is fired the 2nd time (when the ‘error’ occurs) the renderer is still on the first page, it has not added a new page yet as it has no prior knowledge whether the new section will fit on the current (first) page or not. So the test does not work as expected, and it is not a bug in FlexReport.

    To print something on the first page only, one can use a boolean flag which is reset after the first use. I added a _firstPrinted flag that does just that, and it works as desired.

    Thanks,

    Singh

    TestReport-fixed.zip

Need extra support?

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

Learn More

Forum Channels