THE SQL Server Blog Spot on the Web
Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | Join | Help
in Search

Roman Rehak

'ASP.NET session has expired' error in the ReportViewer control

I deployed an ASP.NET  application to another server and the page that includes a few ReportViewer controls started showing the "ASP.NET session has expired" error in each report. The same web app worked totally fine on my box. I didn’t have time to investigate before I moved on to other work and then a few days later I came across a solution to the problem by accident when reading a KB article related to RS security on WebHost4Life.com. They suggested changing the AsyncRendering property to false. Since there are some performance penalties when turning off asynchronous rendering, I decided to make it a setting in Web.config and turn it off only if needed:

 

      bool asyncRendering = bool.Parse(ConfigurationManager.AppSettings.Get("AsyncRendering"));
      rptvAverageOrder.ServerReport.ReportServerUrl = rsUrl;

After I tried that, the error went away but I ended up with another issue. Reports with images (in my case charts) ended up having a missing image with that ugly placeholder with an X in it. I did some googling and found out that this can happen if asynchronous rendering in ReportViewer is off and the server name contains an underscore as it does in my case so these two issues are related. When I use the IP address or "localhost" in the URL, everything works fine regardless of how this property is set. Also, some people pointed out is that if you turn off asynchronous rendering, reports get messed up when viewed with Firefox. I will report this as an issue on Microsoft Connect and I guess in the meantime we have to avoid deploying ReportViewer applications on servers with underscores in their names.

 


Published Friday, May 04, 2007 12:20 PM by roman

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Anonymous Coward said:

Man, that is a *painful* font.

May 8, 2007 3:44 PM
 

roman said:

Believe it or not, that's my default font in Outlook 2007, that's where I write my entries and then just paste them here. I changed it to something more normal.

May 8, 2007 7:09 PM
 

TrackBack said:

May 10, 2007 9:51 AM
 

G.V.Senthilkumar said:

When I set When cookieless="true" then I got the error in my report page ..."asp.net session expired". After than I changed the parameter cookieless="False",Then my report is working fine.But some of the other page Images is not loaded properly.I am getting page images its shown and some of the images is not shown.I unable to find the reason.

Can you help me.

August 28, 2007 10:12 AM
 

Sam Ranjbari said:

set this in web.config

<sessionState timeout ="120" mode="InProc" cookieless="true" />

May 30, 2008 2:55 PM
 

Chris May said:

I started getting this error on our report viewer also.

I am wondering if it is related to some changes where we increased the number of worker processes on the webserver.

If anyone has any other info, I would be interested.

June 3, 2008 1:00 PM
 

Vinod_Yadav1919 said:

Hii Roman Rehak!!

Even for our application we got the same error, and finally resolved by following the solution provided in this link.

https://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=3071515&SiteID=17

November 4, 2008 10:46 PM

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement