Hidden elements not working correctly

Posted by: janek.haberer on 8 July 2021, 12:08 pm EST

    • Post Options:
    • Link

    Posted 8 July 2021, 12:08 pm EST

    Hello,

    using the newest version of ActiveReports.NET 15 running inside a Linux Docker container there is some weird behaviour when trying to get an element to only show on the last page of a report.

    Setting the visibility->hidden expression to “=iif(Globals!PageNumber = Globals!TotalPages, False, True)” results in the element showing up on each page. Same for “=iif(Globals!PageNumber < Globals!TotalPages, True, False)”.

    Now this is where it gets really weird: If you put these expressions into a text field, they calculate the correct value for each page(i.e. True on every but the last page). Let’s say a report has 5 pages and instead of using Globals!TotalPages you put 5 into the expressions above instead, it will work correctly again. However the amount of pages varies, so this is no solution.

    Any help would be greatly appreciated!

  • Posted 12 July 2021, 3:32 pm EST

    Hello,

    I am not able to reproduce the issue at my end. Could you please confirm is this issue only replicate on Linux environment?

    Thanks,

    Mohit

  • Posted 13 July 2021, 2:47 pm EST

    When trying to create a small reproducable example I realized that it only happens when using a subreport in a list. I created a report with a textbox and set hidden to “=iif(Globals!PageNumber = Globals!TotalPages, False, True)”. Then I created a new report and put the first report as a subreport into a list.

    Now the textbox appears on every but the first page for me, which might be because the expression above is evaluated for each subreport separately as in each subreport is a one page report which would result in Globals!PageNumber and Globals!TotalPages always being 1?

    My element needs to be inside the subreport, is this somehow achievable?

  • Posted 14 July 2021, 3:54 am EST

    Hello,

    Are you using the PageReport or RDL Report?

    Thanks,

    Mohit

  • Posted 14 July 2021, 6:32 am EST

    Hello,

    I am using a RDL Report. However when using a PageReport which has a list containing a Textbox with hidden set to the same as usual the Textbox still shows up on each page.

    I need a front page to be a summary followed by pages each containing a table of details for an item where on each page a different item is detailed. On the last page however I want an element to show up below that table.

    Hope this clears things up!

  • Posted 15 July 2021, 1:51 pm EST

    Hello,

    Can you add TextBox below the subreport control to show the element on the Report?

    Thanks,

    Mohit

  • Posted 16 July 2021, 8:22 am EST

    Hello,

    I tried a few different things and it currently seems like lists are the main problem.

    If I make a Page Report with a list and a TextBox below, the TextBox shows up on every page.

    Putting the TextBox below a list in a RDL Report makes the TextBox correctly show up only on the last page, however the subreport I am using for the list has a specific header and footer different to the very first page. I am unsure as to how get my element between the last table of my list and the corresponding footer.

  • Posted 19 July 2021, 2:57 pm EST

    Hello,

    Is there any chance, can you know the last element in the database?

    Thanks,

    Mohit

  • Posted 21 July 2021, 8:21 am EST

    Hello,

    Yes, I do, I was hoping to avoid that way but it does work.

    Thanks for the help!

Need extra support?

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

Learn More

Forum Channels