【发布时间】:2017-03-27 09:25:56
【问题描述】:
我正在尝试将参数从 Winform 传递到 Crystal Report,但出现此错误
缺少参数值
我的代码:
PrintCashReport cashreport = new PrintCashReport();
rptvwrcash.ReportSource = cashreport;
ParameterFields paramfields = new ParameterFields();
ParameterField type = new ParameterField();
type.Name = "type";
ParameterDiscreteValue dvtype = new ParameterDiscreteValue();
dvtype.Value = DailySalesReportBL.typeofrpt;
type.CurrentValues.Add(dvtype);
paramfields.Add(type);
rptvwrcash.ParameterFieldInfo = paramfields;
//PrintCashReport cashreport = new PrintCashReport();
cashreport.SetDataSource(ds);
cashreport.SetParameterValue("type", DailySalesReportBL.typeofrpt);
//rptvwrcash.ReportSource = cashreport;
System.Drawing.Printing.PrintDocument printDocument = new System.Drawing.Printing.PrintDocument();
cashreport.PrintOptions.PrinterName = printDocument.PrinterSettings.PrinterName;
cashreport.PrintOptions.PrinterName = "EPSON TM-T88V Receipt";
cashreport.PrintToPrinter(1, false, 0, 0);
我在 Crystal Report 中检查了参数的名称,这也很好。我检查了值,它也得到了正确的值。
所以请帮我找出我哪里弄错了。
谢谢
【问题讨论】:
标签: c# parameters crystal-reports