Thursday, March 29, 2012

Export fails under Forms Authentication

I am developing a Web site using VS.Net 2005 using Forms authentication under
ASP.Net 2.0. The user enters a SQL logon and password, we authenticate that,
then use an embedded logon and password for all SQL calls. It works fine,
except when I try to export a report.
I have ReportViewer embedded on an aspx form, using local processing. The
report opens just fine, accepts parameter changes and renders correctly.
However, when I select an Export format and click Export, I get an "ASP.NET
session has expired" message with the following stack trace:
[AspNetSessionExpiredException: ASP.NET session has expired]
Microsoft.Reporting.WebForms.ReportDataOperation..ctor() +335
Microsoft.Reporting.WebForms.ExportOperation..ctor() +24
Microsoft.Reporting.WebForms.HttpHandler.GetHandler() +281
Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext
context) +34
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +64
I've been developing in VB and SQL for over 10 years, but I'm new to .Net
and Report Service. I've searched books and Web sites, and nothing I've
found mentions this problem or anything like it (which I'm sure means I'm
looking in the wrong place!).
Thanks.When I click on Export, I get a new IE instance, and the ASP session
identifier in the URL is different. If I replace it with the same string in
the IE instance that displays the reportViewer, the Export works just fine.
Now I need to figure out how to force the Export to open under the same ASP
session.
"Paul Gettys" wrote:
> I am developing a Web site using VS.Net 2005 using Forms authentication under
> ASP.Net 2.0. The user enters a SQL logon and password, we authenticate that,
> then use an embedded logon and password for all SQL calls. It works fine,
> except when I try to export a report.
> I have ReportViewer embedded on an aspx form, using local processing. The
> report opens just fine, accepts parameter changes and renders correctly.
> However, when I select an Export format and click Export, I get an "ASP.NET
> session has expired" message with the following stack trace:
>
> [AspNetSessionExpiredException: ASP.NET session has expired]
> Microsoft.Reporting.WebForms.ReportDataOperation..ctor() +335
> Microsoft.Reporting.WebForms.ExportOperation..ctor() +24
> Microsoft.Reporting.WebForms.HttpHandler.GetHandler() +281
> Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext
> context) +34
> System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
> System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously) +64
> I've been developing in VB and SQL for over 10 years, but I'm new to .Net
> and Report Service. I've searched books and Web sites, and nothing I've
> found mentions this problem or anything like it (which I'm sure means I'm
> looking in the wrong place!).
> Thanks.
>|||I found an answer to my own problem, but I'm not sure it is the best
practice. I have to edit the ASP.NET configuration for the site to use
Cookies.
Under State Management, change the Cookieless mode selection to UseCookies.
This (as the documentation explains) causes the site to use Session cookies
to retain the security information, which successfully passes to the browser
window opened by the Export command on the ReportViewer control.
This appears to pass 508 Compliance muster for cookies, but Iâ'm still
checking on that.
"Paul Gettys" wrote:
> When I click on Export, I get a new IE instance, and the ASP session
> identifier in the URL is different. If I replace it with the same string in
> the IE instance that displays the reportViewer, the Export works just fine.
> Now I need to figure out how to force the Export to open under the same ASP
> session.
> "Paul Gettys" wrote:
> > I am developing a Web site using VS.Net 2005 using Forms authentication under
> > ASP.Net 2.0. The user enters a SQL logon and password, we authenticate that,
> > then use an embedded logon and password for all SQL calls. It works fine,
> > except when I try to export a report.
> >
> > I have ReportViewer embedded on an aspx form, using local processing. The
> > report opens just fine, accepts parameter changes and renders correctly.
> > However, when I select an Export format and click Export, I get an "ASP.NET
> > session has expired" message with the following stack trace:
> >
> >
> > [AspNetSessionExpiredException: ASP.NET session has expired]
> > Microsoft.Reporting.WebForms.ReportDataOperation..ctor() +335
> > Microsoft.Reporting.WebForms.ExportOperation..ctor() +24
> > Microsoft.Reporting.WebForms.HttpHandler.GetHandler() +281
> > Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext
> > context) +34
> >
> > System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
> > System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> > completedSynchronously) +64
> >
> > I've been developing in VB and SQL for over 10 years, but I'm new to .Net
> > and Report Service. I've searched books and Web sites, and nothing I've
> > found mentions this problem or anything like it (which I'm sure means I'm
> > looking in the wrong place!).
> >
> > Thanks.
> >

No comments:

Post a Comment