[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Trying to display SSRS report with parameters from ASP.NET (VB) page

Posted on 2013-12-05
4
Medium Priority
?
744 Views
Last Modified: 2013-12-22
I have deployed 2 SSSRS reports to my localhost report server - one has a parameter, the other does not. When viewed through localhost/Reports, both reports are fine. For the parameterized report there is a prompt for my parameter and the report displays correctly.

Now I want to open this report from an asp page. The code works fine for the non-parameterized report.  The parameterized report, however, throws a javascript error when it hits the Refresh command and the report tries to open.  Interestingly, if I comment out the code for setting the parameter values, the report opens as it would when viewed through LocalHost/Reports but as soon as I type in the parameter, an error is thrown.

So I'm thinking the problem is not so much in the code, but perhaps some linkage between my web application and the report server, but I have no idea what to look at.

Here is the code:

Imports Microsoft.Reporting.WebForms
Public Class ReportViewer
    Inherits System.Web.UI.Page

Private Sub DisplayBlendSheet()
ReportViewer1.ServerReport.ReportServerUrl = New System.Uri("http://localhost/ReportServer")
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote
ReportViewer1.ServerReport.ReportPath = "/PTS Reports/Blend Sheet"
Dim rptParams As New System.Collections.Generic.List(Of Microsoft.Reporting.WebForms.ReportParameter)
rptParams.Add(New Microsoft.Reporting.WebForms.ReportParameter("BlendID", "BN13290"))
ReportViewer1.ServerReport.SetParameters(rptParams)
ReportViewer1.ServerReport.Refresh()
End Sub
End Class

Open in new window


The error I get is not very informative (to me anyway):
JavaScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 404

Any help would be much appreciated.
0
Comment
Question by:Lisa412
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 27

Expert Comment

by:planocz
ID: 39704492
This may help; it is written in VB.net
this code will produce a pdf ssrs report.

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Q_26665879.html
0
 

Accepted Solution

by:
Lisa412 earned 0 total points
ID: 39725031
I finally found a solution which I will share here because I hate when I find a problem just like mine without an answer!

The problem has something to do with the way the ReportViewer control is rendered in VS 2010. It goes through several postbacks in its process. So the code to set up the report and set the parameters must be prefaced by an IsPostBack check, else it just goes into an endless loop.

That's what mine was doing anyway. Now it opens fine, with or without parameters.

Now I can't get it to close properly, but I'll open a separate question for that :)

Thanks to planocz for trying to help. I really wanted to be able to use the features of the report viewer, not just create a pdf.
0
 

Author Closing Comment

by:Lisa412
ID: 39734460
My solution allows me to open report in report viewer, not pdf
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question