为什么在我为它编写代码时,Crystal报表提示我输入参数字段值。
Private void ReportVeiwer_Load(object sender, EventArgs e)
{
ReportDocument reportdoc = new ReportDocument();
///string invoice_number = (;
Invoice invoicerpt = new Invoice();
ParameterField paramfield = new ParameterField();
ParameterFields paramfields = new ParameterFields();
paramfield.Name = "Invoice_Number";
ParameterDiscreteValue dicval = new ParameterDiscreteValue();
dicval.Value = User_Info.invoice_number;
paramfield.CurrentValues.Add(dicval);
paramfields.Add(paramfield);
ReportVeiwer rptveiwer = new ReportVeiwer();
rptveiwer.crystalReportViewer1.ParameterFieldInfo = paramfields;
reportdoc.Load(@"D:\Furqan\SchoolManagementSystem\SchoolManagementSystem\Invoice.rpt");
crystalReportViewer1.ReportSource = reportdoc;
reportdoc.SetDatabaseLogon("PC-Name/User", "Password", ".", "Database");
}
答案 0 :(得分:0)
首先加载报告。然后,设置参数值...