2018.1.4 compiled report reading variables bug

Stimulsoft Reports.WEB discussion
FrenkR
Posts: 131
Joined: Mon Jan 05, 2015 12:15 am

2018.1.4 compiled report reading variables bug

Post by FrenkR »

Hello,
when setting variable in Page.Render() Event, variable is not properly read in .CompiledReport.Rendering() event or RenderedPages.PageAdded() event. Report is set to "DoublePass"(must be).

It looks like variables are not updated to latest/current values.

myVar should be in following sequence:
Page_1
Page_1
Page_2
Page_2
Page_1
Page_1
Page_2
Page_2

actual otuput is:
Page_4
Page_4
Page_1
Page_1
Page_2
Page_2
Page_1
Page_1
rep_variable.png
rep_variable.png (12.56 KiB) Viewed 3675 times
comp. ver 2018.1.4:

Example with bug is included.
Attachments
StimulsoftPageNumbers.zip
(64.51 KiB) Downloaded 153 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: 2018.1.4 compiled report reading variables bug

Post by Alex K. »

Hello,

We need some additional time to check the issue.

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

Re: 2018.1.4 compiled report reading variables bug

Post by FrenkR »

hello, any news about this issue?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: 2018.1.4 compiled report reading variables bug

Post by Alex K. »

Hello,

We work hard on this problem and do our best to do it as fast as possible. We will let you know when the solution is available.

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

Re: 2018.1.4 compiled report reading variables bug

Post by FrenkR »

Hello, any news about this issue?
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: 2018.1.4 compiled report reading variables bug

Post by HighAley »

Hello, Frenk.

We have analyzed your issue carefully.
We are sending you a table of the events where you could see their order during rendering.

You are storing a page number to the myVar variable in the Page_Rendering event.
But this event fired after the Page_Added and Report_Rendering events, where you show the myVar variable.
So you get the page number of the previous page.
This order of the events is made by design. We don't have plans to change it.

Because of the peculiarity of the report engine, for the first page the BeforePrint and BeginRender events raise in the reverse order. But this has no effect of your issue.

Thank you.
Attachments
events.png
events.png (24.2 KiB) Viewed 3520 times
FrenkR
Posts: 131
Joined: Mon Jan 05, 2015 12:15 am

Re: 2018.1.4 compiled report reading variables bug

Post by FrenkR »

this worked in version 2016.3 from december 2016. We tried to update report engine in our project to latest version and found out that this stopped working.
Was there any special reason that this was changed? Also for me there is no logic to have different variables in event, than actually printed in report.
FrenkR
Posts: 131
Joined: Mon Jan 05, 2015 12:15 am

Re: 2018.1.4 compiled report reading variables bug

Post by FrenkR »

Ok I understand that events are changed for some reason. For having backward compatibility(to solve our case), can you define additional event "PageEndRender()" on "CompiledReport" level? This event should be triggered after Page.Rendering() or Page.EndRender() (this option would even be better), please?

Rgds,
Frenk
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: 2018.1.4 compiled report reading variables bug

Post by Alex K. »

Hello,

> Ok I understand that events are changed for some reason.

The order of events has been changed by request on your previous ticket, that the page number is correctly displayed in all these events.
You can set
StiOptions.Engine.FixPageNumberInEvents = false
to set the old order of events, but the page numbers will be incorrect.

> For having backward compatibility(to solve our case), can you define additional event "PageEndRender()" on "CompiledReport" level?
> This event should be triggered after Page.Rendering() or Page.EndRender() (this option would even be better), please?

Unfortunately, we see no sense in adding a duplicate event "Report.PageEndRender". You can use Page.EndRender event.

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

Re: 2018.1.4 compiled report reading variables bug

Post by FrenkR »

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. 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.
I can not set/assign page events on "rendering engine". On this level, I have only "CompiledReport.Render()" event and RenderedPages.PageAdded(). There is no event, that would be able to read valid variable values, that are set inside "page" events, set via designer.
As I was suggesting, I would need "CompiledReport.PageRendered()" event, which would then have same system variables(page number, number of pages, etc.) and variables, set during page rendering(e.g. assigning variable value during page.render() event inside report template).

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.
Post Reply