Before Print event behavior differs between heavy client application and web app

Stimulsoft Reports.WEB discussion
Post Reply
Alex92
Posts: 8
Joined: Fri Jul 28, 2023 4:09 am

Before Print event behavior differs between heavy client application and web app

Post by Alex92 »

Hello,

To give a little bit of context, I use Stimulsoft Designer v2023.2.8 to design reports. The designer is accessible from within a heavy client application. The report viewer is accessible from that same heavy client application, but also from a Web App.

When I design reports for the heavy client app, the data source is sql server. When from web app, it is a JSON object.

For one report generated from the heavy client application, I am using a Before Print event with a simple routine to check if a certain element has to be displayed in color or not. It works. (see pic - for each group of identical left number, it alternates black and white)

I have to design the same behavior in a report generated from the Web app part. I use strictly the same routine, variables and Before Print event. Everything is white.

Say that number is datasource X of integer type. I created 2 variables of integer type, Y and Black, initialized to 0.
That rectangle has a condition on it, if Black = 1 it will be colored in black, otherwise it will remain white.
My before print even in both cases is:

if (Y != X)
{Y = X;
if(Black==0)
{Black=1;}
else
{Black=0;}
}

As I said, this works perfectly in the report generated from the desktop application, but not at all from the Web app.

Any idea why this happens?

Thank you for your help.
Attachments
report_black_rectangle.png
report_black_rectangle.png (11.59 KiB) Viewed 758 times
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Before Print event behavior differs between heavy client application and web app

Post by Lech Kulikowski »

Hello,

Most probably, in the Web part is denied Compilation (CalculationMode property of the report), in that case, events are not working.

Try to use the Blockly feature instead the code in events.

Thank you.
Alex92
Posts: 8
Joined: Fri Jul 28, 2023 4:09 am

Re: Before Print event behavior differs between heavy client application and web app

Post by Alex92 »

Hello,

Thanks, I used Blockly for the first time today. I think I was able to redo logic with the blocks but still did not work. So I tried something simpler like changing the background color of a Text element. (Set Property Brush of object Text 1 to Brush Solid Color *chose black*)

I put it in Before Print event. In our desktop app, I can see the preview of my customized report has a black rectangle so I think I assembled well the blocks. However, when I actually generate the report from the Web app with data, the text element has no background color.

Is it related to that "denied Compilation" you mentiony? Is there a way to change that?

Also I noticed the designer version is 2023.2.8 and the viewer version in the Web App is 2020.2.1. Could it be the reason? Do the versions have to be aligned?

Thank you.
Attachments
blockly.jpg
blockly.jpg (17.74 KiB) Viewed 728 times
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Before Print event behavior differs between heavy client application and web app

Post by Lech Kulikowski »

Hello,

Please use the same versions on both sides. We do not guarantee that the report created in the new version will work correctly in the old version.

Thank you.
Alex92
Posts: 8
Joined: Fri Jul 28, 2023 4:09 am

Re: Before Print event behavior differs between heavy client application and web app

Post by Alex92 »

Ok, thank you. I will see if the developers can upgrade the version in the Web app and hopefully it fixes it.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Before Print event behavior differs between heavy client application and web app

Post by Lech Kulikowski »

Hello,

You are welcome.
Post Reply