Crystal Report Error The Parameter Is Incorrect
Contents |
here for a quick overview of the site Help Center Detailed incorrect logon parameters crystal report answers to any questions you might have Meta Discuss
Crystal Reports Incorrect Log On Parameters
the workings and policies of this site About Us Learn more about Stack Overflow the crystal report unable to connect incorrect log on parameters company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss missing parameter values error in crystal report Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Crystal reports The parameter is incorrect C# up vote 0 down vote favorite I have a report that has two
Crystal Report Parameter C#
parameters: ponumber and receiptno. I'm trying to call the report from a C# page where the parameter values are passed in via the URL. When I call the report, I get an error "The parameter is incorrect", but can't figure out why. I've done a variety of code changes based on what I found online, because at first the Report Viewer said there were no parameters, so this approach seems to be better, but doesn't work. My code: string ponumber = Request.QueryString["ponumber"].ToString(); string receiptno = Request.QueryString["receiptno"].ToString(); // Put Away Report CrystalReportSource CrystalReportSource1 = new CrystalReportSource(); CrystalReportViewer CrystalReportViewer1 = new CrystalReportViewer(); ParameterFields paramFields1 = new ParameterFields(); ParameterFields paramFields2 = new ParameterFields(); ParameterField paramField1 = new ParameterField(); ParameterField paramField2 = new ParameterField(); ParameterDiscreteValue paramDiscreteValue1 = new ParameterDiscreteValue(); ParameterDiscreteValue paramDiscreteValue2 = new ParameterDiscreteValue(); paramField1.Name = "@ponumber"; paramDiscreteValue1.Value = ponumber; paramField1.CurrentValues.Add(paramDiscreteValue1); paramField1.HasCurrentValue = true; paramFields1.Add(paramField1); paramField2.Name = "@
here for a quick overview of the site Help Center Detailed crystal report parameter field answers to any questions you might have Meta Discuss the crystal report parameter in sql command workings and policies of this site About Us Learn more about Stack Overflow the company
Crystal Report Parameter Multiple Values Display
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the http://stackoverflow.com/questions/13200234/crystal-reports-the-parameter-is-incorrect-c-sharp Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up crystal report viewer The Parameter is incorrect up vote 0 down vote favorite i tried to pass parameter to crystal report viewer. http://stackoverflow.com/questions/6326219/crystal-report-viewer-the-parameter-is-incorrect but it show The Parameter is incorrect. Dim rpt As New ReportDocument
rpt.FileName = My.Application.Info.DirectoryPath & "\MAuditList.rpt" Dim paramDV As New ParameterDiscreteValue() paramDV.Value = frmMachine.machine rpt.ParameterFields("@mchno").CurrentValues.Clear() rpt.ParameterFields("@mchno").DefaultValues.Clear() rpt.ParameterFields("@mchno").CurrentValues.Add(paramDV) paramDV.Value = frmMachine.batch - 1 rpt.ParameterFields("@batch").CurrentValues.Clear() rpt.ParameterFields("@batch").DefaultValues.Clear() rpt.ParameterFields("@batch").CurrentValues.Add(paramDV) paramDV.Value = InpStdPt rpt.ParameterFields("@Points").CurrentValues.Clear() rpt.ParameterFields("@Points").DefaultValues.Clear() rpt.ParameterFields("@Points").CurrentValues.Add(paramDV) paramDV.Value = OvrPoints rpt.ParameterFields("@ovrpt").CurrentValues.Clear() rpt.ParameterFields("@ovrpt").DefaultValues.Clear() rpt.ParameterFields("@ovrpt").CurrentValues.Add(paramDV) Form1.CrystalReportViewer1.ReportSource = rpt Form1.Show()any error in these code?? vb.net crystal-reports vb.net-2010 share|improve this question edited Jun 13 '11 at 8:56 asked Jun 13 '11 at 2:43 OMG 112 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote You should assign the parameters to your Report object and then assign the report object to your CrystalReportViewer. Try something like this: 'Create report object and load the report Dim rpt As New ReportDocument() rpt.FileName = My.Application.Info.DirectoryPath & "\MAuditList.rpt" 'Set the Parameters Dim paramDV As New ParameterDiscreteValue() paramDV.Value = "Parameter Value" rpt.ParameterFields("@ParameterName").CurrentValues.Clear() rpt.ParameterFields("@ParameterName").DefaultValues.Clear() rpt.ParameterFields("@ParameterName").CurrentValues.Add
SAP Crystal Reports, version for Visual StudioWhere is this place located?All Places SAP Crystal Reports, version for Visual Studio 4 Replies Latest reply: http://scn.sap.com/thread/1138310 Jan 23, 2009 8:06 PM by Don Williams Tweet The parameter is incorrect (Crystal Reports 10.5 and VS2008) Jairo Romero Nov 21, 2008 7:28 PM http://www.dotnetspider.com/forum/289216-The-parameter-incorrect-message-Crystal.aspx Currently Being Moderated Hi we have this situation:We migrated a WinForms application from VS2003 to VS2008 and now we have a problem with crystal reports 10.5(the crystal report version that is bundled with VS2008), when we execute some reports, they show me the error "The parameter is incorrect", but this only happend with reports that have subreports. The weird thing is that if we don't set the parameters (by code) and execute the report, the viewer show me the crystal report parameter window parameter and after we enter the parameters in that window, the report works fine!!!!Someone with any idea what could be the problem?Thanks. 2494Views Re: The parameter is incorrect (Crystal Reports 10.5 and VS2008) Guest Nov 21, 2008 8:41 PM (in response to Jairo Romero) Currently Being Moderated Hi,Have you code for the sub-report parameters seperately.I would like you to know the following code that I have tried at my end using Viewer Object model: // Object Declaration ParameterFields boParameterFields = null; ParameterField boParameterField = null; ParameterValues boParameterValues = null; ParameterDiscreteValue boParameterDiscreteValue = null; ParameterRangeValue boParameterRangeValue = null; // loading the report CrystalReportViewer1.ReportSource = Server.MapPath("ReportWithSubReport.rpt"); CrystalReportViewer1.RefreshReport(); // passing database credentials... foreach(CrystalDecisions.Shared.TableLogOnInfo boTableLogOnInfo in CrystalReportViewer1.LogOnInfo) { ConnectionInfo boConnectionInfo = boTableLogOnInfo.ConnectionInfo; boConnectionInfo.UserID ="sa"; boConnectionInfo.Password="sa"; } // Parameter Country boParameterFields = CrystalReportViewer1.ParameterFieldInfo; boParameterField = boParameterFields["Country"]; boParameterValues = boParameterField.CurrentValues; boParameterDiscreteValue = new ParameterDiscreteValue(); boParameterDiscreteValue.Value = "Argentina"; boParameterValues.Add(boParameterDiscreteValue); // Parameter Sales
You must Sign In to post a response. Category: .NET23 Jun 2011 07:20Himanshu PatelJoined:26/05/2011Level:GoldPoints:1211Points:5The parameter is incorrect message in Crystal report Hi, I'm trying to get a report working in a VS2005 C#.net windowsapplication.The report has 2 database tables that are populated from datasets inthe C#.net code:rpt.Database.Tables(1).SetDataSource(ds1.Tables(0))When I run my report, I get a window (Crystal Report Windows FormsViewer) with a message "The parameter is incorrect." There is 1parameter in the sub report. The error message is notterribly helpful.I tried using a Try..Catch..End Try and catching the exception, both asa regular exception and various kinds ofCrystalDecisions.CrystalReports.Engine exceptions with no luck. Itstill just gives me that original error message. In fact, it doesn'teven seem to catch the error at all.Any Idea? #61660324 Jun 2011 05:34Himanshu PatelJoined:26/05/2011Level:GoldPoints:1211Points:1After all i got the solution........For the people who faced same issue i suggest this steps :CrystalReport1 is a main report.subCrystalReport1 is a sub report. Add one parameter field in main report CrystalReport1 say it 'main_param'.Add one parameter field in main report subCrystalReport1 say it 'sub_param'.Now in main report right click on sub report. Then go to 'Change subreport links...'.In that select 'main_param' which is link to the sub report 'sub_param'.Then set the parameter value 'main_param' like below:report_object.SetParameterValue("main_param", "12345"); crystalReportViewer1.ParameterFieldInfo = report_object.ParameterFields;Thanks and Regards,Himanshu BhensdadiaMicrosoft Certified Professional(MCTS)
This thread is locked for new responses. Please post your comments and questions as a separate thread.If required, refer to the URL of this pag