SSRS: ASP.NET ReportViewer parameters reset to default when clicking View Report

parametersreporting-servicesssrs-2008

I have a SQL Reporting Services report (SQL 2008 built using Report Builder v2.0) which has a multi select integer parameter (in this case a list of stores).

The default value is 0 ("All Stores"). The parameter is passed to a stored procedure as a varchar(1024).

This all works fine in Report Builder or from the Reporting Services website.

However from an ASP.NET website using the ReportViewer component the parameters are reset to the default each time you choose "View Report".

I've tried setting the view to non-asynchronous loading (changes the rendering container?) plus any other setting I could find, without success. Does anyone know a trick to fix this?

Best Answer

I made a mistake. The ReportViewer control was inside a Master Page. Each time the "View Report" button was clicked it did a postback and reset the session.

I added if (!IsPostBack) to before the report setup method.

Related Topic