Passing parameters to remote SSRS report from ASP.NET MVC application -


I have an asp.net MVC application that uses SSRS to report (web form and report Using the viewer). I want to pass two parameters dynamically in the remote report. My current implementation stores the parameters in the session, which works well on the VS development server, but the variable on the IIS is empty, on the recovery in web access.

Here is the controller method that calls the view

  Show public action results (string id) {var report parameter = new dictionary & lt; String, string & gt; (); Report Parameters.Add ("Param1", ID); Report Parameters.Add ("Param2", "user1"); Session ["report parameter"] = report parameter; See Return ("ReportName"); }  

And here's how I try to get the parameter from the web form

  Secure zero page_load (Object Sender, EventArgs e) { Var report parameter = (dictionary & lt; string, string & gt;) session ["report parameter"]; Forex currency (parameter parameter in report) {ReportParameter rp = New report Parameter (item.Key, item.Value); ReportViewer1.ServerReport.SetParameters (RP); }}  

Does anyone know why the session ["report parameter"] is zero? Or is there any other way to pass these parameters?

You can also do this:

Protected Zero Page_Old ( Object Sender, EventAgages e) {if (! Page. ISPostback) {try {var js = new JavaScriptSerializer ()} string report path = request .QueryString ["local report"]; String ParameterTemp = Request JQuery String ["Parameters Report"]; & Lt; ReportParameter & gt; Parameter = null; If (parametrosTemp! = "") {Parameter = JsonConvert.DeserializeObject & lt; List & lt; ReportParameter & gt; & Gt; (ParametrosTemp); } Generate Reports (Report Path, Parameter); } Hold (exception before) {statusReport.Value = ex.Message; }}} Private Zero Generate report (String report path, list & lt; ReportParameter & gt; report parameter) {reportCurrent.ProcessingMode = ProcessingMode.Remote; ServerReport Report Report Server = Report Current Report Server; ServerReport.ReportServerUrl = new URI (AppSettings.URLReportServer); Server report Report page = report path; ServerReport.Refresh (); If (report parameter! = Null) {reportCurrent.ServerReport.SetParameters (report parameter); }}

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -