asp.net水晶报表推模式加载报表数据代码段

SqlParameter[] parms = { new SqlParameter("@CompID",System.Data.SqlDbType.BigInt),
                               new SqlParameter("@StartTime",System.Data.SqlDbType.DateTime),
                               new SqlParameter("@EndTime",System.Data.SqlDbType.DateTime)
                             };
        parms[0].Value = 100001000000000000;
        parms[1].Value = Convert.ToDateTime("2010-01-01");
        parms[2].Value = Convert.ToDateTime("2010-09-01");
        DataSet ds = MsSqlHelper.RunProcedure(RptCom.ConnString, "Report_Wyy_CustBillOnCom", (IDataParameter[])parms, "CustBill", "命令");

 


        //Crs CrystalReportSource
        //Crv CrystalReportViewer
        Crs.ReportDocument.Load(Server.MapPath("RptFile/Rpt_CustomBill.rpt"));
        Crs.ReportDocument.SetDataSource(ds);
        Crs.ReportDocument.SetParameterValue("StartTime", "2010-01-01");
        Crs.ReportDocument.SetParameterValue("EndTime", "2010-09-01");
        Crs.ReportDocument.SetParameterValue("Printer", "打印人");
        Crs.DataBind();
        Crv.ReportSource = Crs;
        Crv.DataBind();

posted @ 2010-07-27 09:54  nnsword  阅读(466)  评论(0编辑  收藏  举报