Crystal Reports for .NET users,
Does any know the why the following error is displayed?
Error breaks on pf = pfs["@Country"] :
Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Source Error:
Line 96: ParameterDiscreteValue spValue; Line 97: pfs = crv1.ParameterFieldInfo; Line 98: pf = pfs["@Country"]; Line 99: spValue = new ParameterDiscreteValue(); Line 100: spValue.Value = cboCountry.SelectedItem.Text; Code:
crv1.ReportSource = (ReportDocument)Session["REPORT"]; crv1.LogOnInfo = new TableLogOnInfos(); TableLogOnInfo MyLogonInfo = new TableLogOnInfo(); MyLogonInfo.TableName = "up_Customers;1"; MyLogonInfo.ConnectionInfo.DatabaseName = "xtreme"; MyLogonInfo.ConnectionInfo.ServerName = "SVRNAME"; MyLogonInfo.ConnectionInfo.UserID="User1"; MyLogonInfo.ConnectionInfo.Password="Pa$$word1"; crv1.LogOnInfo.Add(MyLogonInfo); ParameterFields pfs; IParameterField pf; ParameterDiscreteValue spValue; pfs = crv1.ParameterFieldInfo; pf = pfs["@Country"]; spValue = new ParameterDiscreteValue(); spValue.Value = cboCountry.SelectedItem.Text; pf.CurrentValues.Add(spValue); Session["REPORT"] = rpt;
Report based on the following SQL Command:
DECLARE @RC int DECLARE @Country varchar(50) SET @Country = 'USA' EXEC @RC = [xtreme].[dbo].[up_Customers] @Country
Stored Procedure on SQL Server xtreme database:
ALTER PROCEDURE up_Customers @Country varchar(50) AS SELECT [Customer Name],Address1,City,Region,Country,[Postal Code],Phone FROM Customer WHERE Country = @Country ORDER BY Country, Region, [Customer Name]
Any help would be greatly appreciated, thanks in advance.
dugfmjamul
------------- dugfmjamul
|