crReportDocument.SetParameterValue(0, 6);
crReportDocument.SetParameterValue("@id", 6);when i load report
crReport.ReportSource = crReportDocument fails with error
Failed to open a rowset. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: Procedure 'test' expects parameter '@id', which was not supplied. SQL State: 42000 Native Error: Failed to open a rowset. Error in File C:\DOCUME~1\mkv\LOCALS~1\Temp\Report2 {0A5A6D74-BDAF-4062-8789-C804A1B07D07}.rpt: Failed to open a rowset.
If i use view or table, and create parameter on my own passing parameter works ok. So ther must be some problem with stored procedur parameters, mybe with character @, but this is character which must be suplied in sp, and parameter name populate in crystal i than also @id, .....have anybody some solutions for my probelm, i thnik that this must some bug.....
my sp look like
CREATE PROCEDURE [dbo].[test] @id int AS
select *
from test
where id=@id
GO
thanks
MAtej

StoredProcedure, parameters not working in Crystal .Net loading
Jason Li
XGamerX
Have Business Objects given a timescale on when they will be releasing the update
The workround posted after your reply does not work for my installation.
My difficulty is that I am porting our application to run Windows 2003 (64), Visual Studio 2005 with a live date at the end of January 2006. Part of the functionality is derived from Crystal Reports invoking parameterised stored procedures.
Thanks
Paul
PoulErik
Patrick Oliveros
Jeff Owens
http://www.codecomments.com/Visual_Basic_Crystal_Reports/message690985.html
I just can't understant how can people "guess" that :).
yza suklan
When i provide the login credentials in code, using ConnectionInfo, with the exact same parameters, it fails telling me the procedure expects a parameter which was not supplied.
This is using VS2005 & the built in Crystal stuff.
Shawn Levendusky
etiennemartin
I eventually got a fix from Business Objects. The code below generates a report to a PDF file and highlights the "key line". The sample is based on th PUBS database.
Stored Procedure
CREATE procedure test @state nvarchar(50) as select * from authors where state=@state
ASP.VB code to generate PDF file
Imports
CrystalDecisions.SharedImports
CrystalDecisions.CrystalReports.EnginePartial
Class ux_onlineNET_Reports_UxReports Inherits System.Web.UI.Page Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' This code is the translation code to product PDF crystal reports from Ux-Online. It uses ' .NET code to bypass permissions problems using the older Crystallise code. ' All parmaters are passed in via a redirect from the old Norwegian code to aviod having ' to translate the components Dim rdCrystalDocument As New ReportDocument Dim oExO As ExportOptions Dim oExDo As New DiskFileDestinationOptions Dim myTable As Table Dim myLogin As TableLogOnInfo Dim myParamValue As New ParameterDiscreteValue Dim myParamValue1 As New ParameterDiscreteValue Dim myParamValue2 As New ParameterDiscreteValue Dim PDFname As String, RepNum As String, ReportName As String Dim AuditSessionID As String Const PDF_REPORT_PATH As String = "/" 'Load reportAuditSessionID = 0
ReportName = Server.MapPath(PDF_REPORT_PATH) &
"\CrystalReport.rpt"PDFname =
"Report-" & AuditSessionID & ".pdf" Dim param As String = "@state" Dim value As String = "CA" Dim dbname As String = "pubs"rdCrystalDocument.Load(ReportName, OpenReportMethod.OpenReportByTempCopy)
myParamValue.Value = value
rdCrystalDocument.SetParameterValue(param, myParamValue)
' Set database and logon information For Each myTable In rdCrystalDocument.Database.TablesmyLogin = myTable.LogOnInfo
With myLogin.ConnectionInfo ' The error occurs with this setting. Set the server name to be "." i.e. the local server and the ' file works. '.ServerName = "." ' Replace the name volvo.ux-connect.com with the DNS name or your server name ' and uncomment the line you will then get the error 'Failed to open a rowset. 'Details: 42000:[Microsoft][ODBC SQL Server Driver][SQL Server]Procedure 'test' expects parameter '@state', which was not supplied.Failed to open a rowset.Error in File C:\WINDOWS\TEMP\CrystalReport {FA1D0B63-13C3-4959-91ED-DF9E122E66FE}.rpt: 'Failed to open a rowset..ServerName =
"volvo.ux-connect.com".Password =
"".UserID =
"sa".DatabaseName = dbname
End WithmyTable.ApplyLogOnInfo(myLogin)
' THIS IS THE IMPORTANT LINE THE NAME OF THE STORED PROCEDURE 'myTable.Location =
"test;1" Next 'ExportoExDo.DiskFileName = Server.MapPath(PDF_REPORT_PATH) & PDFname
oExO = rdCrystalDocument.ExportOptions
oExO.ExportDestinationType = ExportDestinationType.DiskFile
oExO.ExportFormatType = ExportFormatType.PortableDocFormat
oExO.DestinationOptions = oExDo
rdCrystalDocument.Export()
rdCrystalDocument.Close()
Response.Redirect(PDF_REPORT_PATH & PDFname)
End SubEnd
Class