private void bindReport() { string ReportCode = Request["ReportCode"]; DataTable dt = new Bll.BusinessFun.ConsultReportDal().getpollPublish(ReportCode); //var date = Request["date"]; // = date.replace("-", "/"); DataTable dt2 = new DataTable(); this.ReportViewer2.ProcessingMode = ProcessingMode.Local; this.ReportViewer2.PageCountMode = PageCountMode.Actual; //报表参数设置 this.ReportViewer2.LocalReport.ReportPath = "Devoops/ConsulCir/AirPublishReport.rdlc"; string level = dt == null ? "" : dt.Rows[0]["YJColor"].ToString(); string forecastlevel = GetLevelColor(level) + "【" + level + "】"; ReportParameter plevel = new ReportParameter("level", forecastlevel.ToString());//dt.Rows[0]["forecastlevel"] ReportParameter rpYearDate = new ReportParameter("date", dt == null ? "" : Convert.ToDateTime(dt.Rows[0]["ReportTime"]).ToString("yyyy 年 MM 月 dd 日")); //dt == null ? "" : Convert.ToDateTime(dt.Rows[0]["ReportTime"]).ToString("yyyy 年 MM 月 dd 日") ReportParameter poll = new ReportParameter("poll", dt == null ? "" : dt.Rows[0]["Basiscontent"].ToString()); ReportParameter op = new ReportParameter("op", dt == null ? "" : dt.Rows[0]["maincontent"].ToString()); this.ReportViewer2.LocalReport.SetParameters(new ReportParameter[] { rpYearDate, poll, op, plevel });//,plevel ReportViewer2.LocalReport.DisplayName = "朔州市重污染天气预警信息发布(解除)审批表" + DateTime.Now.ToString("yyyy年MM月dd日"); //报表数据设置 this.ReportViewer2.LocalReport.DataSources.Clear(); this.ReportViewer2.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt2)); this.ReportViewer2.DataBind(); }
private void bindReport() { string ReportCode = Request["ReportCode"].ToString(); DataTable dt = new Bll.BusinessFun.ConsultReportDal().getpoll(ReportCode); this.ReportViewer1.ProcessingMode = ProcessingMode.Local; this.ReportViewer1.PageCountMode = PageCountMode.Actual; //报表参数设置 this.ReportViewer1.LocalReport.ReportPath = "Devoops/ConsulCir/pollutionDayliy.rdlc"; this.ReportViewer1.LocalReport.EnableExternalImages = true; MergerImage(dt.Rows[0]["ExpertSign"].ToString(), "tmpExpert"); MergerImage(dt.Rows[0]["CheckSign"].ToString(), "tmpCheck"); string imgExpertUrl = "http://" + Request.Url.Authority + "/szair/Devoops/img/sign/tmpExpert.png"; //"http://" + Request.Url.Authority + "/FrameworkCoin/Devoops/img/sign/tmpExpert.png"; string imgCheckUrl = "http://" + Request.Url.Authority + "/szair/Devoops/img/sign/tmpCheck.png"; //"http://" + Request.Url.Authority + "/FrameworkCoin/Devoops/img/sign/tmpCheck.png"; ReportParameter imgExpert = new ReportParameter("imgExpert", dt.Rows[0]["ExpertSign"].ToString() == "" ? "" : imgExpertUrl);//(null || "") //ReportParameter imgExpert = new ReportParameter("imgExpert", imgExpertUrl); ReportParameter imgCheck = new ReportParameter("imgCheck", dt.Rows[0]["CheckSign"].ToString() == "" ? "" : imgCheckUrl); //ReportParameter imgCheck = new ReportParameter("imgCheck", imgCheckUrl); ReportParameter rpYearDate = new ReportParameter("rpYearDate", Convert.ToDateTime(dt.Rows[0]["ReportTime"]).ToString("yyyy 年 MM 月 dd 日")); ReportParameter poll = new ReportParameter("poll", dt == null ? "" : dt.Rows[0]["Conclusions"].ToString()); ReportParameter op = new ReportParameter("op", dt == null ? "" : dt.Rows[0]["Opinion"].ToString()); ReportParameter rpUser = new ReportParameter("rpUser", dt == null ? "" : dt.Rows[0]["U_RealName"].ToString()); this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rpYearDate, poll, op, imgExpert, imgCheck, rpUser }); ReportViewer1.LocalReport.DisplayName = "朔州市重污染天气预报会商意见" + DateTime.Now.ToString("yyyy年MM月dd日"); //报表数据设置 this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt)); this.ReportViewer1.DataBind(); }
public DataTable GetWarnDetailData(string regionName, string hour1, string hour2, int page, int rows, ref int rowcount, ref int countPage) { string sql = "select * from T_Mid_AirForeCast where StationName='" + regionName + "' and CONVERT(varchar(30),MonitorTime,120)>CONVERT(varchar(30),'" + hour1 + "',120) and CONVERT(varchar(30),MonitorTime,120)<CONVERT(varchar(30),'" + hour2 + "',120) Order by MonitorTime desc"; DataSet infoSet = ConsultReportDal.Paging(sql, page, rows, ref rowcount, ref countPage); if (infoSet != null && infoSet.Tables.Count == 3) { DataTable infoTable = infoSet.Tables[2]; return(infoTable); } else { return(null); } }
public DataTable GetWarnInfoData(string begin, string end, int page, int rows, ref int rowcount, ref int countPage) { string sql = "select f.ReportTime as FutureDate,f.ReportCode as ReportCode,f.AQI as AQI,g.Category as Category,g.ColorName as ColorName,g.ColorCode,g.Grade,g.RadiusColor from (select distinct e.ReportTime,d.AQI,d.ReportCode,d.QualityLevel from (select AQI,ReportCode,QualityLevel from T_Mid_ReportData) d inner join (select b.ReportCode,MIN(AQI) as AQI,b.ReportTime FROM T_Mid_ReportData a inner join T_Mid_Report b on a.ReportCode=b.ReportCode where a.AQI>=200 group by b.ReportTime,b.ReportCode) e on d.ReportCode=e.ReportCode and d.AQI=e.AQI) f inner join T_Bas_WarningLevel g on (f.QualityLevel-4)=g.id"; sql += " where convert(varchar(15),f.ReportTime ,23)>=convert(varchar(15),'" + begin + "',23) and convert(varchar(15),f.ReportTime ,23)<= convert(varchar(15),'" + end + "',23) order by f.ReportTime desc"; DataSet infodataset = ConsultReportDal.Paging(sql, page, rows, ref rowcount, ref countPage); if (infodataset != null && infodataset.Tables.Count == 3) { DataTable infoTable = infodataset.Tables[2]; return(infoTable); } else { return(null); } }
public DataTable GetForeCastCheckData(string beginDate, string endDate, string strCheckID, int forecastmodel, int page, int rows, ref int rowcount, ref int countPage) { SQLHelper sqlh = new SQLHelper(); //string sql = @"select * from V_Mid_AirForeCastNew where Convert(varchar(30),MonitorTime,23)>=Convert(varchar(30),'" + beginDate + "',23) and Convert(varchar(30),MonitorTime,23)<=Convert(varchar(30),'" + endDate + "',23) and StationCode in(" + strCheckID + ") and forecastmodel=" + forecastmodel + " order by MonitorTime desc"; string sql = @"select * from V_Mid_AirForeCastNew where MonitorTime>='" + beginDate + "' and MonitorTime<='" + endDate + "' and StationCode in(" + strCheckID + ") and forecastmodel=" + forecastmodel + " order by MonitorTime desc"; DataSet infodataset = ConsultReportDal.Paging(sql, page, rows, ref rowcount, ref countPage); if (infodataset != null && infodataset.Tables.Count == 3) { DataTable infoTable = infodataset.Tables[2]; return(infoTable); } else { return(null); } }
private void LoadPlloReport(string code) { DataTable dt = new Bll.BusinessFun.ConsultReportDal().GetPollByCode(code); if (dt != null) { this.ReportViewer2.ProcessingMode = ProcessingMode.Local; this.ReportViewer2.PageCountMode = PageCountMode.Actual; //报表参数设置 this.ReportViewer2.LocalReport.ReportPath = "Devoops/ConsulCir/pollutionDayliy.rdlc"; ReportParameter rpYearDate = new ReportParameter("rpYearDate", Convert.ToDateTime(DateTime.Now).ToString("yyyy 年 MM 月 dd 日")); ReportParameter poll = new ReportParameter("poll", dt == null ? "" : dt.Rows[0]["Conclusions"].ToString()); ReportParameter op = new ReportParameter("op", dt == null ? "" : dt.Rows[0]["Opinion"].ToString()); this.ReportViewer2.LocalReport.EnableExternalImages = true;//设定EnableExternalImages属性为TRUE this.ReportViewer2.LocalReport.SetParameters(new ReportParameter[] { rpYearDate, poll, op }); ReportViewer2.LocalReport.DisplayName = ConfigurationManager.AppSettings["CityName"].ToString() + "重污染天气预报会商意见" + DateTime.Now.ToString("yyyy年MM月dd日"); //报表数据设置 this.ReportViewer2.LocalReport.DataSources.Clear(); this.ReportViewer2.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", new DataTable())); this.ReportViewer2.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // string level= Request["level"] == null ? "" : Request["level"]; userName = Session["userName"].ToString(); string ReportCode = Request["ReportCode"] == null ? "" : Request["ReportCode"]; //string level = Request["level"] == null ? "" : Request["level"]; string level = ""; DataTable dt = new Bll.BusinessFun.ConsultReportDal().getpollPublish(ReportCode); if (dt != null && dt.Rows.Count > 0) { txt_basis.Text = dt == null ? "" : dt.Rows[0]["Basiscontent"].ToString(); txt_main.Text = dt == null ? "" : dt.Rows[0]["maincontent"].ToString(); lbl_pulish.Text = dt == null ? "" : Convert.ToDateTime(dt.Rows[0]["ReportTime"]).ToString("yyyy 年 MM 月 dd 日"); level = dt == null ? "" : dt.Rows[0]["YJColor"].ToString(); lbl_level.Text = GetLevelColor(level) + "【" + level + "】"; } else if (dt == null) { txt_basis.Text = null; txt_main.Text = null; lbl_pulish.Text = null; lbl_level.Text = null; } // lbl_level.Text = dt == null ? "" : dt.Rows[0]["YJDJ"].ToString(); //if (Session["userName"] != null) //{ // labelUser.Text = Session["userName"].ToString(); //} //else //{ // Response.Write("<script>top.window.location.href = '../Login.aspx';</script>"); //} //lbl_level.Text = level + "【" + GetLevelColor(level) + "】"; } }
private void bindReportPublish(string code) { DataTable dt = new Bll.BusinessFun.ConsultReportDal().getpollPublishBycode(code); if (dt != null) { DataTable dt2 = new DataTable(); this.ReportViewer3.ProcessingMode = ProcessingMode.Local; this.ReportViewer3.PageCountMode = PageCountMode.Actual; //报表参数设置 this.ReportViewer3.LocalReport.ReportPath = "Devoops/ConsulCir/AirPublishReport.rdlc"; ReportParameter rpYearDate = new ReportParameter("date", Convert.ToDateTime(DateTime.Now).ToString("yyyy 年 MM 月 dd 日")); ReportParameter poll = new ReportParameter("poll", dt.Rows[0]["Basiscontent"].ToString()); ReportParameter op = new ReportParameter("op", dt.Rows[0]["maincontent"].ToString()); ReportParameter plevel = new ReportParameter("level", dt.Rows[0]["forecastlevel"].ToString()); this.ReportViewer3.LocalReport.SetParameters(new ReportParameter[] { rpYearDate, poll, op, plevel }); ReportViewer3.LocalReport.DisplayName = ConfigurationManager.AppSettings["CityName"].ToString() + "重污染天气预警信息发布(解除)审批表" + DateTime.Now.ToString("yyyy年MM月dd日"); //报表数据设置 this.ReportViewer3.LocalReport.DataSources.Clear(); this.ReportViewer3.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt2)); this.ReportViewer3.DataBind(); } }