我有一个水晶报告,我正在尝试将标签的文本传递给水晶报告。但是每当我尝试这样做时,它都会询问或参数值。我有另一种形式,它做了同样的事情,但它工作正常。这是我尝试过的代码:
crystalReportViewer1.RefreshReport();
ParameterFields paramFields = new ParameterFields();
ParameterField paramField = new ParameterField();
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
paramField = new ParameterField();
paramDiscreteValue = new ParameterDiscreteValue();
paramField.Name = "kot";
paramDiscreteValue.Value = NewOrderBL.KOTNo;
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
paramField = new ParameterField();
paramDiscreteValue = new ParameterDiscreteValue();
paramField.Name = "TotalVat";
paramDiscreteValue.Value = NewOrderBL.totalvat;
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
paramField = new ParameterField();
paramDiscreteValue = new ParameterDiscreteValue();
paramField.Name = "TotalService";
paramDiscreteValue.Value = NewOrderBL.totalservicetax;
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
paramField = new ParameterField();
paramDiscreteValue = new ParameterDiscreteValue();
paramField.Name = "TotalAmount";
paramDiscreteValue.Value = NewOrderBL.totalamount;
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
paramField = new ParameterField();
paramDiscreteValue = new ParameterDiscreteValue();
paramField.Name = "TotalServiceTax";
paramDiscreteValue.Value = NewOrderBL.totalservicetax1;
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
NewOrderBL 是一个类文件,我将上面的变量定义为公共静态十进制(变量名)
请帮忙。