Report compilation error - How to prevent CS file deletion ?

Stimulsoft Reports.WEB discussion
kgb2013
Posts: 85
Joined: Fri Nov 01, 2013 9:52 am
Location: Earth

Re: Report compilation error - How to prevent CS file deleti

Post by kgb2013 »

Hello.

What is wrong with it ?
When I use the SQL Profiler to see the infinite queries being sent to the DB, the SQL query seems OK.
SQL Server executes them with no problem.
Am I mising something?

EDIT:
I have also tried changing "string.IsNullOrWhiteSpace" to "string.IsNullOrEmpty" (that you once suggested for me for some reason) but it didn't help.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Report compilation error - How to prevent CS file deleti

Post by Alex K. »

Hello,

Sorry, I have not noticed that you call Connect() method for datasource in BeforePrint event of Page. You should connect only once, but in your report this occurs many times and caused a looping.

Please try to add the additional variable which will be indicate that datasource is already connected.

Thank you.
Attachments
Capture.PNG
Capture.PNG (103.55 KiB) Viewed 7179 times
51_2.mrt
(27.36 KiB) Downloaded 281 times
kgb2013
Posts: 85
Joined: Fri Nov 01, 2013 9:52 am
Location: Earth

Re: Report compilation error - How to prevent CS file deleti

Post by kgb2013 »

Thanks.

How can I do this?
Is this OK (if I put it on BeforePrint)? :

Code: Select all

if(!Ekkrem.IsConnected) Ekkrem.Connect();
(Now that I've tried it, it seems to prevent the problem.)
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Report compilation error - How to prevent CS file deleti

Post by Alex K. »

Hello,

In previous post i attach the modified report in which have added an additional boolean variable and use it in BeforePrint event.
Your code also should work.

Thank you.
kgb2013
Posts: 85
Joined: Fri Nov 01, 2013 9:52 am
Location: Earth

Re: Report compilation error - How to prevent CS file deleti

Post by kgb2013 »

Thanks.
But, could my solution (check for `Ekkrem.IsConnected`) do the same thing?
It seems simpler too.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Report compilation error - How to prevent CS file deleti

Post by Alex K. »

Hello,

Yes.
Let us know if you need any additional help.
kgb2013
Posts: 85
Joined: Fri Nov 01, 2013 9:52 am
Location: Earth

Re: Report compilation error - How to prevent CS file deleti

Post by kgb2013 »

OK.
Thanks a lot! :)
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Report compilation error - How to prevent CS file deleti

Post by Alex K. »

We are always glad to help you!
Post Reply