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

Stimulsoft Reports.WEB discussion
Post Reply
fuhrj
Posts: 120
Joined: Wed Jun 11, 2008 12:51 pm
Location: Lancaster, Ohio

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

Post 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.
fuhrj
Posts: 120
Joined: Wed Jun 11, 2008 12:51 pm
Location: Lancaster, Ohio

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

Post 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.
Andrew
Posts: 4107
Joined: Fri Jun 09, 2006 3:58 am

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

Post 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.
fuhrj
Posts: 120
Joined: Wed Jun 11, 2008 12:51 pm
Location: Lancaster, Ohio

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

Post 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:
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

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

Post by Edward »

Hi

Great news :)

Please let us know if you need any help.

Thank you.
Post Reply