StiConfig.applicationDirectory in a web application

Stimulsoft Reports.WPF discussion
Post Reply
Patrick8639
Posts: 12
Joined: Wed Mar 17, 2010 10:50 am
Location: Lausanne, Switzerland

StiConfig.applicationDirectory in a web application

Post by Patrick8639 »

Hello,
when we use InitWeb in StimulReport, it sets the StiConfig.applicationDirectory to HttpContext.Current.Server.MapPath(String.&Empty).
The problem is that if the current page that is calling InitWeb is not on a physical folder but on a virtual one, applicationDirectory is set to an non-existent folder and, during the compiling of the report, StimulReport makes this directory the default one and crashes.
It would be better to use the directory where the StimulReport dll is located, or use HttpRuntime.AppDomainAppPath.
Patrick
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

StiConfig.applicationDirectory in a web application

Post by Andrew »

Hello,

Unforunately, we cannot change the code. because this may cause problems for other users. The StiConfig.ApplicationDirectory property supports get/set methods. Assign the required value to it.

Thank you.
Patrick8639
Posts: 12
Joined: Wed Mar 17, 2010 10:50 am
Location: Lausanne, Switzerland

StiConfig.applicationDirectory in a web application

Post by Patrick8639 »

Andrew,
perhaps this can cause problems for other users, but you can perhaps avoid the crash in StimulReport, or change the directory when there is an exception in this line of code.
Or, at least, catch the exception and replace the message with something more useful for the user.
Patrick
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

StiConfig.applicationDirectory in a web application

Post by Jan »

Hello Patrick,

It have sense. We have updated our source code.

Thank you.
Post Reply