Monday, March 12, 2012

Remote Report Server 2005 using the reportviewer control - parameter problem

I am using an asp.net web page (C#) to access a remote Report Server via the reportviewer contol. After solving the credentials issues, all of my test reports seem to run very nicely if there is no parameter input. When a parameter report is executed, the text box for parameter input is displayed. When the parameter is entered and the View Report button is pressed, the report is NOT Returned. If I go directly to the remote Report Manager and run the report (IE no code behind), it runs as it is supposed to. I've also run the report (web page) on my local report server and it displays the report after the parameter has been input. Why is the remote report server not returning the report after the parameter is input?

Thanks,

John

This problem has been resolved. The page will not work if the "ReportViewer1.ServerReport.ReportServerCredentials = new MyReportServerCredentials();" statement is placed in the Page_Load event.

Here are the steps taken to eliminate the problem:

1. Remove the credentials statement from the Page_Load event.

2. Place this code in the Page_Load event

if (!Page.IsPostBack)
{
ReportViewer1.Visible = false;
}

3. Place a button on the page to display the report.

4. Move all report statements to the push button event. Make sure to include "ReportViewer1.Visible = true"

It now works like a champ and I am happy!

Thanks,

John

No comments:

Post a Comment