Page 1 of 1

Unable to save report (in web) when using a prepared statement

Posted: Mon Nov 23, 2009 12:47 pm
by fuhrj
I have a report that contains a form with a drop-down list.

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;
The report works fine and displays on the screen.

However, if the user tries to save the report to PDF, Word, or Excel, I get the following error:
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 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?

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.

Unable to save report (in web) when using a prepared statement

Posted: Mon Nov 23, 2009 3:52 pm
by fuhrj
I've isolated the problem to the StiWebViewer control.

If I set RenderMode to "UseCache", I am able to save the report to a PDF, Word, or Excel file.

If I set the mode to "Ajax" or "AjaxWithCache", I get the missing parameter error message.

I don't quite understand why it doesn't work with with these two modes. We have another web-based product that uses AjaxWithCache and it works fine.

Unable to save report (in web) when using a prepared statement

Posted: Tue Nov 24, 2009 2:36 am
by Andrew
Hello,

It is difficult to say something without additional information. So please send your .aspx page and your code to support@stimulsoft.com.

Thank you.

Unable to save report (in web) when using a prepared statement

Posted: Tue Nov 24, 2009 4:22 pm
by fuhrj
I was able to resolve the issue by upgrading from version 2008.2.247.0 to 2008.2.300.0.

There must have been a bug in the older version or something.

:biggrin:

Unable to save report (in web) when using a prepared statement

Posted: Thu Nov 26, 2009 10:13 am
by Edward
Hi

Great news :)

Please let us know if you need any help.

Thank you.