Problem generating reports on web site

Stimulsoft Reports.NET discussion
gunde99
Posts: 27
Joined: Tue Jul 31, 2012 11:23 am

Problem generating reports on web site

Post by gunde99 »

Hi!

I have an aspx-page loading a mrt-file and saving it as pdf:

Code: Select all

stiReport1.Load(rootPath + "\\report.mrt");
//Connecting SQL Server data source
stiReport1.Dictionary.Databases.Clear();
stiReport1.Dictionary.Databases.Add(new StiSqlDatabase("SQLConnection", cstr));

Stimulsoft.Report.Export.StiPdfExportSettings pdf = new Stimulsoft.Report.Export.StiPdfExportSettings();
pdf.Compressed = true;
...
stiReport1.Render();
stiReport1.ExportDocument(StiExportFormat.Pdf, file, pdf);
Works on my local machine with Stimulsoft installed but not on a web-hotel. After a couple of minutes I get "webpage cannot be displayed". I've increased all time-out settings way beyond that. I've also copied all .dll and .exe files from Stimulsoft\Bin\ to my web site\Bin\. What else should I do?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problem generating reports on web site

Post by HighAley »

Hello.

What trust level is set for your project?
Do you have write permissions on the server?

Thank you.
gunde99
Posts: 27
Joined: Tue Jul 31, 2012 11:23 am

Re: Problem generating reports on web site

Post by gunde99 »

Hello!

The trust level is set to Medium on the web server. Is it enough? I've tried to change it to Full in the web.config but that was not allowed.
I have write permissions and the aspx page can create other files in that folder.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problem generating reports on web site

Post by HighAley »

Hello.

This issue was solved in the latest prerelease build. Please, download it and set next property:

Code: Select all

StiOptions.Engine.FullTrust = false;
Thank you.
gunde99
Posts: 27
Joined: Tue Jul 31, 2012 11:23 am

Re: Problem generating reports on web site

Post by gunde99 »

Hello!

Thanks for your advice.

When using the setting:

Code: Select all

StiOptions.Engine.FullTrust = false;
The report generates an empty (5-6Kb) pdf-file both on my local machine and on the web-server.

Setting it to:

Code: Select all

StiOptions.Engine.FullTrust = true;
...makes it work locally but gives the same "webpage cannot be displayed"-error on the web-server.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problem generating reports on web site

Post by HighAley »

Hello.

Please, make sure that your project take the latest assemblies.
Read the How the Runtime Locates Assemblies article http://msdn.microsoft.com/en-us/library ... v=vs.80%29.
As you could read there the common language runtime check for Previously Referenced Assemblies and the Global Assembly Cache.
So you should remove ALL old assembles from your system.
Please, replace assemblies from GAC with latest ones and search all over your system for any other our assemblies.

Thank you.
gunde99
Posts: 27
Joined: Tue Jul 31, 2012 11:23 am

Re: Problem generating reports on web site

Post by gunde99 »

I've removed all the assemblies from GAC. Deleted all files in Temporary ASP.NET files. Referenced the right version in the web.config. It worked once but than again it started to create empty files. Debugging the code showed that the call:

stiReport1.Render();

...only took a micro-second even if the report has 49 pages, so I guess it's where it all goes wrong. Which assemlies are used during rendering. Should I reference any of the .exe files?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problem generating reports on web site

Post by HighAley »

Hello.

Please, try to use next code:

Code: Select all

stiReport1.CalculationMode = StiCalculationMode.Interpretation;
stiReport1.Render();
Thank you.
gunde99
Posts: 27
Joined: Tue Jul 31, 2012 11:23 am

Re: Problem generating reports on web site

Post by gunde99 »

Interesting!

When changing the calculationMode I get "Incorrect syntax near '}'"- error (see attached screenshot). I have a couple of stored procedures with parameters (within brackets {...}) and it seems that in this mode, they are not supplied to the execute-call. When I don't set the CalculationMode it works fine (on my computer)

Also I've replaced my .mrt file with a simple one with only one page and no datasources and it works fine to generate the PDF-file on the web-server so I guess the trust-level and assemblies are ok. I will try to add more advanced charts and datasources and hopefully isolate the one(s) that's causing the problem. Meanwhile all ideas and suggestions are of great value.

Thanks!
Attachments
report_error.JPG
report_error.JPG (313.05 KiB) Viewed 3622 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problem generating reports on web site

Post by HighAley »

Hello.

We've mead some improvements. Please, check our next prerelease build.

Thank you.
Post Reply