protected void DOPrintButton_Click(object sender, EventArgs e)
{
ReportDocument reportdocument = new ReportDocument();
ParameterField paramField = new ParameterField();
ParameterFields paramFields = new ParameterFields();
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
paramField.Name = "@GatePass";
paramDiscreteValue.Value = GPLabel.Text;
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
CrystalReportViewer1.ParameterFieldInfo = paramFields;
reportdocument.Load(Server.MapPath("~/DO_Report.rpt"));
CrystalReportViewer1.ReportSource = reportdocument;
CrystalReportViewer1.DataBind();
reportdocument.Refresh();
reportdocument.SetDatabaseLogon("sa", "Admin1");
reportdocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat,Response,true,"Report");
Response.End();
}
请帮忙????? 此代码错误"缺少参数值" 救命...........? 我想将水晶报告导出为PDF格式,但我尝试了很多代码。