Request is not available in this context

Stimulsoft Reports.WEB discussion
Post Reply
JoshR
Posts: 7
Joined: Tue Oct 30, 2012 1:42 pm

Request is not available in this context

Post by JoshR »

Hello.

After finding that the StiWebViewer toolbar options do not work inside an update panel, I read that it might be possible to use ajax to load the report.

I initialise the viewer with this:

Code: Select all

<Sti:StiWebViewer ID="viewer" runat="server" Theme="Office2010" CacheMode="Page" RenderMode="AjaxWithCache" />
I created a web method to run the report, and used jquery ajax to post to the web method, and it works fine up until I hit this line of code:

Code: Select all

this.viewer.ProcessReport();
This causes the following exception:

Code: Select all

Message":"Request is not available in this context",
"StackTrace":"   at System.Web.UI.Page.get_Request()
at Stimulsoft.Report.Web.StiWebViewer.GetApplicationUrl(Boolean addQuerySeparator)
at Stimulsoft.Report.Web.StiWebViewer.GetApplicationUrl()
at Stimulsoft.Report.Web.StiWebViewer.GetSessionId()
at Stimulsoft.Report.Web.StiWebViewer.get_ViewMode()
at Stimulsoft.Report.Web.StiWebViewer.RenderReport(StiReport report)
at Stimulsoft.Report.Web.StiWebViewer.ProcessReport()
at Stimulsoft.Report.Web.StiWebViewer.set_Report(StiReport value)
at Application.Reports.LoadReport(StiReport report) in Reports.aspx.cs:line 91
at Application.Reports.RunReport(Int32 reportID) in ReportsPresenter.cs:line 143
at Application.Reports.RunReport(Int32 reportID) in Reports.aspx.cs:line 176",
"ExceptionType":"System.Web.HttpException"
I wonder if you could tell me if it is possible to load a report using ajax only (so not requiring a page reload)? If there is a way to get it working inside an update panel, then this would also be fine.

Cheers,
Josh.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Request is not available in this context

Post by HighAley »

Hello.

You don't need ProcessReport() method.
You should just pass your report the Report property of the StiWebViewer.

Thank you.
Post Reply