Parameters with stored proc

Stimulsoft Reports.NET discussion
marine88
Posts: 18
Joined: Mon Feb 22, 2010 2:18 pm

Parameters with stored proc

Post by marine88 »

Created a stored proc on the designer side and passing a param to it only I can't seem to figure out why its getting this error.
error CS0117: 'Reports.Report' does not contain a definition for 'Estimate_Number'

My code I think is pretty much right on.
Dim test As String = Request.QueryString("ID")
'sqlcmd.Parameters.Add("@MJH_Number", SqlDbType.VarChar).Value = CType(ddlMJH_Number.SelectedValue, String)

Dim rootWebConfig As System.Configuration.Configuration
rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/PM2")
Dim connString As New System.Configuration.ConnectionStringSettings
If (0 < rootWebConfig.ConnectionStrings.ConnectionStrings.Count) Then
connString = rootWebConfig.ConnectionStrings.ConnectionStrings("PM1ConnectionString")
End If
Dim sqlcon As New SqlConnection(connString.ConnectionString)
Dim report As Stimulsoft.Report.StiReport = New Stimulsoft.Report.StiReport

sqlcon.Open()
report.Load(Server.MapPath("~/Forms/Work_Orders/phtowrkordprint.mrt"))

report.Item("@Estimate_Number") = test
report.Compile()


report.Render(True)
StiWebViewer1.Report = report
sqlcon.Close()
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Parameters with stored proc

Post by Jan »

Hello,

Please send to support@stimulsoft.com your report for examination. Also let me know about version of report generator.

Thank you.
marine88
Posts: 18
Joined: Mon Feb 22, 2010 2:18 pm

Parameters with stored proc

Post by marine88 »

I sent it already. Version of report gen is 2009.3.600
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Parameters with stored proc

Post by Edward »

Hi,

Thank you very much for the report template.

Please delete '@Estimate_Number' variable from the Dictionary. The defined parameter with the same name is enough for sending value for stored procedure.

Thank you.
marine88
Posts: 18
Joined: Mon Feb 22, 2010 2:18 pm

Parameters with stored proc

Post by marine88 »

Thanks Edward,
I did that but all I get are the labels and no data. Tested the stored proc in sql and it returns data. Is the code correct?
marine88
Posts: 18
Joined: Mon Feb 22, 2010 2:18 pm

Parameters with stored proc

Post by marine88 »

tried everything I know to do and still no data. I can see my parameter is passed but the data is not showing in my form.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Parameters with stored proc

Post by Edward »

Hi

Thanks for the Email. Please send report template along with the explanation of the latest problem.

Thank you.
marine88
Posts: 18
Joined: Mon Feb 22, 2010 2:18 pm

Parameters with stored proc

Post by marine88 »

I got it working but I thought I did not need to drag the data source over to the template but rather drag the fields themselves. So you need a databand which establishes a dataconn and then the datasources over or the columns into the databand? I got used to crystal reports way of thinking sorry.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Parameters with stored proc

Post by Edward »

Hi

If there is no datasource in the report template, it only means that only first record of the DataSource will be rendered.

You do not have to drag and drop datasource into the page to have that one record rendered. Link to datacolum is enough.

But I think that the error in your case was connected with the name of the DataSource assigned to DataBand. It might happen that the DataSource name was changed in the Dictionary or deleted, but DataSource still contained an old name which caused the exception.

Thank you.
marine88
Posts: 18
Joined: Mon Feb 22, 2010 2:18 pm

Parameters with stored proc

Post by marine88 »

Thanks, I think your right cause I was able to do it yesterday. Interesting....but thanks for the reply. Great software!! Enjoy the support you guys give and great tutorials.
Post Reply