This is a migrated thread and some comments may be shown as answers.

Null Reference Exception when switching to/from Print Preview when a report has expired

1 Answer 88 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stephen McDaniel
Top achievements
Rank 1
Stephen McDaniel asked on 21 Jan 2015, 10:23 PM
We are running into a problem where our users will see a Null Reference Exception message ("Object reference not set to an instance of an object") when they switch to (or from) Print Preview mode after the report has "expired".  Sometimes the report will expire because they waited too long (I think 20 minutes is the timeout on most of our servers) or if IIS happened to recycle while they were working on the report.  For other operations (such as changing pages), the user gets a friendly message that says: "Report is unavailable or session has expired".  It would be nice if they got a similiar friendly message in the Print Preview case.

We are on a slightly old version of Reporting but I've verified the bug is in the latest version (Q3 2014 SP1).  We use the Silverlight report viewer.

To reproduce the problem, run a report.  Then on the server you can execute the following method to clear out the cache (simulating IIS recycling or the session timing out):

        private void ClearCache()
        {
            var cache = System.Web.HttpContext.Current.Cache;
            var enumerator = cache.GetEnumerator();
            while (enumerator.MoveNext())
            {
                cache.Remove((string)enumerator.Key);
            }
        }

Then when you go to Print Preview mode, you'll see the error.  Screenshot attached.

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 26 Jan 2015, 02:19 PM
Hi Stephen,

Thank you for reporting the problem.

We logged the issue for improvement to provide more friendly message and your Telerik points are update.


Let us know if we can be of any further help for you.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Stephen McDaniel
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or