public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rptParam rpt = new rptParam(); rpt.Site = this.Site; return(rpt); }
private void btnByParam_Click(object sender, EventArgs e) { //加载文件的方式 //ReportDocument doc = new ReportDocument(); ////设置报表文件为“始终复制” //doc.Load(@"CrystalReport\rptParam.rpt"); rptParam doc = new rptParam(); crystalReportViewer1.ParameterFieldInfo = new ParameterFields(); doc.SetParameterValue("txtTitle", "水晶报表参数测试"); doc.SetParameterValue("txtContent", "<font color=red>我是有色内容</font>".PadRight(10000, '=')); //自定义参数添加方法,来自MSDN可能会用到 //AddParameter("txtTitle", "水晶报表参数测试", crystalReportViewer1.ParameterFieldInfo); //AddParameter("txtContent", "<font color=red>我是有色内容</font>".PadRight(10000, '='), crystalReportViewer1.ParameterFieldInfo); crystalReportViewer1.ReportSource = doc; }
private void btnByParam_Click(object sender, EventArgs e) { //加载文件的方式 //ReportDocument doc = new ReportDocument(); ////设置报表文件为“始终复制” //doc.Load(@"CrystalReport\rptParam.rpt"); rptParam doc = new rptParam(); crystalReportViewer1.ParameterFieldInfo = new ParameterFields(); doc.SetParameterValue("txtTitle", "水晶报表参数测试"); doc.SetParameterValue("txtContent", "<font color=red>我是有色内容</font>".PadRight(10000, '=')); //自定义参数添加方法,来自MSDN可能会用到 //AddParameter("txtTitle", "水晶报表参数测试", crystalReportViewer1.ParameterFieldInfo); //AddParameter("txtContent", "<font color=red>我是有色内容</font>".PadRight(10000, '='), crystalReportViewer1.ParameterFieldInfo); crystalReportViewer1.ReportSource = doc; }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rptParam rpt = new rptParam(); rpt.Site = this.Site; return rpt; }