An exception occurred when the Crystal Report parameter was assigned: Invalid index

Source: Internet
Author: User


At the same time this error occurred, and I immediately thought,

1. Whether the parameter is set or not; so I'll check it out right away. Is the parameter set? eedle Yes.

2. I have not updated the report template so open the Explorer, copy and update the report template under the Debug/bin directory

Running, or making a mistake?

So I turned to the leader and found my parameter setting was problematic.

A parameter field has been created Count1 (string) has a small and big parameter in the report that references the same count parameter segment

Then recreate the parameter field small and big and refer to the template as shown

Run ok! Success




</pre></p><p><pre name= "code" class= "CSharp" ><span style= "font-size:18px;" > Code:   private void Commonfunction ()        {            #region set parameter                      doc. Setparametervalue ("Year", Getdatebystr (1,this.date.text));            Doc. Setparametervalue ("Month", Getdatebystr (2, This.date.Text));            Doc. Setparametervalue ("Day", Getdatebystr (3, This.date.Text));            Doc. Setparametervalue ("num", this.num.Text);            Doc. Setparametervalue ("unit", This.cbUnit.Text + "paragraph");            Doc. Setparametervalue ("Big1", this.txtBig.Text);            Doc. Setparametervalue ("Small", Moneyformat (this.txtSmall.Text) + "Yuan");                               #endregion            this.crystalReportViewer1.ReportSource = doc;        } </span>


Note the name of each parameter is the same as the parameter setting the Name property value to be consistent otherwise an exception occurs






An exception occurred when the Crystal Report parameter was assigned: Invalid index

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.