Running a stored procedure fails

Stimulsoft Ultimate discussion
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Running a stored procedure fails

Post by Alex K. »

Hello,

Please try to set the default values for parameters in datasource.

Thank you.
davids
Posts: 20
Joined: Sat Dec 08, 2012 5:56 am

Re: Running a stored procedure fails

Post by davids »

They have default values. Even if they didn't, that can't be the issue because it isn't getting to the data source. With a bad connection string, it doesn't tell me the server is unavailable or the login failed. The code your application generates throws an error even before the login to the db is used.

Did you try running the report exactly as I sent it on the same application and version I am using?

I sent screen shots showing what happens on my machine when I do that. What happens on your machine when you do that?

Should I be using a different version? I need mvc, so if the current version has a bug, can I get a previous version for testing? Otherwise, what am I doing wrong? Or, when can I expect a fix so I can finish my testing?

I would really like to make your product work, but if I can't figure out what I am doing wrong, or the "bug" cannot be fixed, then your product cannot help me. Which is too bad because I have already started telling my customers that we are hoping to be able to make it work.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Running a stored procedure fails

Post by Alex K. »

Hello,

We are working on the problem. We need some additional time for analysis the issue.
We will let you know when the solution is available.

Thank you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Running a stored procedure fails

Post by Alex K. »

Hello,

In your procedure you uses the reserved keyword "Type".
Please try to rename the Name and Alias properties.

Thank you.
Attachments
Screen.PNG
Screen.PNG (277.12 KiB) Viewed 47301 times
davids
Posts: 20
Joined: Sat Dec 08, 2012 5:56 am

Re: Running a stored procedure fails

Post by davids »

Thank you for that. I didn't realize that would create an issue.

I am making progress, it now hits the db and tells me that the params for the procedure are not getting provided. The sp on the server has default values so I shouldn't HAVE to pass a value, but it appears that the report wants me to provide them.

I haven't been able to find a tutorial on how to create a form, or view, or whatever to allow the user to provide param values, or how to set a default param value in the report in the .net version of your solution. Please help me find documentation on that.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Running a stored procedure fails

Post by Alex K. »

Hello,

As a way, you can try to add the additional variable with property "Request From User" and use them in parameters expression.

Thank you.
davids
Posts: 20
Joined: Sat Dec 08, 2012 5:56 am

Re: Running a stored procedure fails

Post by davids »

I cannot find the property "Request from user" and I am not sure where I can set that. None of the fields I have looked at has that as an option.

Where do I specify that property?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Running a stored procedure fails

Post by Alex K. »

Hello,

Please see the screenshot in attachment.

Thank you.
Attachments
Screen.PNG
Screen.PNG (157.99 KiB) Viewed 47264 times
davids
Posts: 20
Joined: Sat Dec 08, 2012 5:56 am

Re: Running a stored procedure fails

Post by davids »

I did as you suggested and added a variable.
Screen shot of variable
Screen shot of variable
Variables.png (256.47 KiB) Viewed 47262 times
If I call it @lcClass I get this error:
The error of compilation
The error of compilation is found in the 'Report' report:
'Reports.Report' does not contain a definition for 'lcClass' and no extension method 'lcClass' accepting a first argument of type 'Reports.Report' could be found (are you missing a using directive or an assembly reference?)
erroring on this line of code

Code: Select all

this.@lcClass = "";
If I call it anything else I get the old error:
The parameterized query '(@lcClass varchar(8),@lcPartStart varchar(25),@lcPartEnd varchar' expects the parameter '@lcClass', which was not supplied.
Statement(s) could not be prepared.
Stack Trace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at Stimulsoft.Report.Dictionary.StiSqlSource.UpdateParameters()
at Stimulsoft.Report.Dictionary.StiSqlAdapterService.ConnectDataSourceToData(StiDictionary dictionary, StiDataSource dataSource, Boolean loadData)
at Stimulsoft.Report.Dictionary.StiDataSource.Connect(StiDataCollection datas, Boolean loadData)
at Stimulsoft.Report.Dictionary.StiDataSourcesCollection.Connect(StiDataCollection datas, Boolean loadData)
at Stimulsoft.Report.Dictionary.StiDictionary.Connect(Boolean loadData)
at Stimulsoft.Report.Engine.StiRenderProviderV2.ConnectToData(StiReport report)
at Stimulsoft.Report.Engine.StiRenderProviderV2.Render(StiReport report, StiRenderState state)
at Stimulsoft.Report.Engine.StiReportV2Builder.RenderSingleReport(StiReport masterReport, StiRenderState renderState)
at Stimulsoft.Report.StiReport.RenderReport(StiRenderState renderState)
at Stimulsoft.Report.StiReport.Render(StiRenderState renderState, StiGuiMode guiMode)
at Stimulsoft.Report.Design.Controls.StiDesignerWebPreviewControl.btRefresh_Click(Object sender, EventArgs e)
I don't see how I am supposed to connect this variable with the stored procedure parameter. Where do I link them together?
davids
Posts: 20
Joined: Sat Dec 08, 2012 5:56 am

Re: Running a stored procedure fails

Post by davids »

I figured out how to link the variables with the parameters...I am making progress.

I have two parameters with type of smalldatetime. When I set a variable to type `datetime` (Value OR Nullable Value) I get the error:
Error converting data type nvarchar to smalldatetime.
If I make the variables type `string` I get the error:
Failed to convert parameter value from a String to a DateTime.
If I make both parameter AND variable VarChar and string respectively, I get the error:
Error converting data type nvarchar to smalldatetime.
the stored procedure requires a smalldatetime value, how do I setup a variable to allow this?
Post Reply