2018.1.4 compiled report reading variables bug

Stimulsoft Reports.WEB discussion
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: 2018.1.4 compiled report reading variables bug

Post by Edward »

Hi Frenk,
Hello, here I believe it is a bit of misunderstanding. In 2016 we talked about this page numbers and everything was prepared (or fixed) perfectly.
Previously, the events order was as follows:
Page.Rendering -> Report.Rendering -> Page.Added.
The correct number of the page is calculated before the Page.Added event, so in the Page.Rendering and Report.Rendering events the page number was incorrect.

Upon your request we have done the fix: we have added the StiOptions.Engine.FixPageNumberInEvents = true; option.

The events order has become as follows:
Page.Added -> Report.Rendering -> Page.Rendering
That is much more logical events order and everyone was absolutely happy with that!
After that fix was implemented, we have not changed anything in the events order nor in the page number calculations.
Change, that was done from 2016.1 to 2018.1 was, that in 2016 version, when variable value was set, it was read correctly via RenderedPages.PageAdded() event.
In 2018.1, page numbers are ok, but variable values, set in "page.render()" event, are not read properly.
Correct, as it was mentioned above, the Page.Rendering event is now being called after the Page.Added.
I can not set/assign page events on "rendering engine". On this level, I have only "CompiledReport.Render()" event and RenderedPages.PageAdded().
Could you please explain this point in more details?
For example. I define variable "MyVariable". Inside report rendering, I define new variable value for each page(event Render() ), e.g. MyVariable = {PageNumber} + "newOrder";
Then in "rendering engine" event "CompiledReport.Render()", or "RenderedPages.PageAdded()", I read value of variable "MyVariable" and system variable "PageNumber".
Inside this (engine) event, PageNumber and MyVariable value must have have same values, that are also rendered on currently added page
Please note, that in the Page.Added event a new EMPTY page is being added.
The page content will start its rendering only after the Page.BeforePrint event.

The report engine does have its complexity and some specifics, that is true. But in order to suggest you the correct events for your task, we need to understand your task better.

We are here to help you to solve the problem you faced. Could you please give us an example, so we could provide you with a good solution?

Thank you,
Edward
FrenkR
Posts: 131
Joined: Mon Jan 05, 2015 12:15 am

Re: 2018.1.4 compiled report reading variables bug

Post by FrenkR »

I have checked again version. Currently working one is 2016.3. from 7.dec. 2016. After update to latest 2018.1, system variables are ok, but user defined variables, that are set via "page.render()" event inside report template are not.
For us it is only important that value of ALL variables(event set with "render" event in report template) are showing same values as if they are on rendered report page. In 2016.3 version, this demo code works perfectly.

Thank you again for your time.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: 2018.1.4 compiled report reading variables bug

Post by Edward »

Hi Frenk,

Good news then, no problems at all! Thank you for the update.
Please feel free to attach a sample report that reproduces the issue you mentioned with setting the user-defined variables in the Render() event, we will try to suggest you a workaround or to fix the bug if we are able to reproduce it.

Thank you,
Edward
Post Reply