When the user clicks the button to run the report, I set the @parameter contained in my sql to the value of the selected item.
Code: Select all
ReportData.Parameters["@queueID"].ParameterValue = queueID;
However, if the user tries to save the report to PDF, Word, or Excel, I get the following error:
I think the report display works because I'm setting the queueID value, but when saving, it's creating a postback event? So how do I set the queueID parameter when saving a report?Prepared statement '(@queueID int,@startDate datetime,@endDate datetime)if (@queueID' expects parameter @queueID, which was not supplied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Prepared statement '(@queueID int,@startDate datetime,@endDate datetime)if (@queueID' expects parameter @queueID, which was not supplied.
I should also mention that if the report is ran in the Designer, I can save. It's only when the report is saved in the web viewer that it fails.