protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); string alarmType = Convert.ToString(this.alarmType.Text); //string ambulanceState = Convert.ToString(this.HiddenForambulanceState.Value); string ambulanceState = Convert.ToString(this.HiddenForambulanceState.Value); string callNumber = Convert.ToString(this.callNumber.Text); string ambulance = Convert.ToString(this.ambulance.Text); string driver = Convert.ToString(this.driver.Text); string doctor = Convert.ToString(this.doctor.Text); string sceneAddress = Convert.ToString(this.sceneAddress.Text); string sendAddress = Convert.ToString(this.sendAddress.Text); string name = Convert.ToString(this.name.Text); string illReason = Convert.ToString(this.illReason.Text); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/LS_HJSJ.rdlc"); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); LSDAL dal = new LSDAL(); DataTable dt = dal.Get_LS_HJSJ(start, end, alarmType, ambulanceState, callNumber, name, ambulance, driver, doctor, sceneAddress, sendAddress, illReason); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_HJSJ", dt)); this.ReportViewer1.LocalReport.Refresh(); }
protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); string workCode = Convert.ToString(this.WorkCode.Text); string centerID = Convert.ToString(this.Center.Text); string stationID = Convert.ToString(this.Station.Text); E_StatisticsPermisson em = UserOperateContext.Current.getMaxPerForStatistics(); string selfWorkCode = UserOperateContext.Current.Session_UsrInfo.WorkCode; string selfCenterID = UserOperateContext.Current.Session_UsrInfo.P_Department.DispatchSubCenterID; string selfStationID = UserOperateContext.Current.Session_UsrInfo.P_Department.DispatchSationID; string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/LS_BLTXSJ.rdlc"); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); LSDAL dal = new LSDAL(); DataTable dt = dal.Get_LS_BLTXSJ(start, end, workCode,centerID,stationID, em,selfWorkCode,selfCenterID,selfStationID); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_BLTXSJ", dt)); this.ReportViewer1.LocalReport.Refresh(); }
protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); //string workState = (this.HiddenForStartWorkState.Value); string workState = (this.HiddenForStartWorkState.Value); string time = Convert.ToString(this.WorkStateTime.Text); string name = Convert.ToString(this.DispatcherName.Text); string personCode = Convert.ToString(this.WorkNumber.Text); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/" + reportName); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); LSDAL dal = new LSDAL(); TJDAL dalt = new TJDAL(); switch (reportName) { case "LS_DDYGZZT.rdlc"://调度员工作状态流水表 DataTable dt = dal.Get_LS_DDYGZZT(start, end, workState, time, name, personCode); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_DDYGZZT", dt)); break; case "TJ_DDYGZZT.rdlc"://调度员工作状态统计表 DataTable dt1 = dalt.Get_TJ_DDYGZZT(start, end, workState, name, personCode, time); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_DDYGZZT", dt1)); break; default: break; } this.ReportViewer1.LocalReport.Refresh(); }
protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); string center = (this.Center.Text).ToString(); string station = (this.Station.Text).ToString(); string name = Convert.ToString(this.Name.Text); string workCode= Convert.ToString(this.WorkCode.Text); string carNumber = (this.CarNumber.Text).ToString(); int time = Convert.ToInt32(this.Time.Text); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/" + reportName); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); LSDAL dal = new LSDAL(); TJDAL dalt = new TJDAL(); switch (reportName) { case "LS_SJCCQK.rdlc"://司机出车大于5分钟流水表 DataTable dt = dal.Get_LS_SJCCQK(start, end,center,station,name,workCode,carNumber,time); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_SJCCQK", dt)); break; case "TJ_SJCCDY5FZ.rdlc"://司机出车大于5分钟统计表 DataTable dt1 = dalt.Get_SJCCDY5FZ(start, end,center,station,name,workCode,carNumber,time); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_SJCCDY5FZ", dt1)); break; default: break; } this.ReportViewer1.LocalReport.Refresh(); }
protected void BindReportDataSource() { string year = (this.Year.Text).ToString(); string month = (this.Month.Text).ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/TJ_SLQKFZ.rdlc"); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", year); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", month); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); TJDAL dal = new TJDAL(); DataTable dt = dal.Get_SLQKFZ(year, month); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_SLQKFZ", dt)); this.ReportViewer1.LocalReport.Refresh(); }
/// <summary> /// 绑定数据源 /// </summary> public void BindReportDataSource() { List<string> OrganizationList = new List<string>(); string strOrgIDs = this.HiddenSelectedOrgIDs.Value; if (!strOrgIDs.Equals("-1")) { if (strOrgIDs.Contains(',')) { OrganizationList = strOrgIDs.Split(',').ToList(); } else { OrganizationList.Add(strOrgIDs); } } else { var listCenter = SessionHelper.GetSession(SessionHelper.SubCenters) as List<center>; OrganizationList = listCenter.Where(c => c.org_sign.Equals(org_sign)).Select(c => c.org_id).ToList(); } DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/" + reportname); string ststr = start.ToString(); string edstr = end.ToString(); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", ststr); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", edstr); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); switch (reportname) { case "ReportPromotionOrganization.rdlc": DataTable dt1 = new PromotionOrganizationBLL().PromotionOrganizationData(start, end, OrganizationList); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt1)); this.ReportViewer1.LocalReport.Refresh(); break; case "ReportServerOrganization.rdlc": DataTable dt2 = new ServerOrganizationBLL().ServerOrganizationData(start, end, OrganizationList); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt2)); this.ReportViewer1.LocalReport.Refresh(); break; default: break; } }
protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); string center = (this.Center.Text).ToString(); string station = (this.Station.Text).ToString(); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/TJ_CLCDFS.rdlc"); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); TJDAL dal = new TJDAL(); DataTable dt = dal.Get_TJ_CLCDFS(start, end, center, station); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_CLCDFS", dt)); this.ReportViewer1.LocalReport.Refresh(); }
protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); string telNumber = (this.TelNumber.Text).ToString(); string disposeResult = (this.HiddenForResult.Value).ToString(); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/TJ_LDJL.rdlc"); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); TJDAL dal = new TJDAL(); DataTable dt = dal.Get_LDJL(start, end, telNumber, disposeResult); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_LDJL", dt)); this.ReportViewer1.LocalReport.Refresh(); }
protected void BindReportDataSource() { string year = (this.Year.Text).ToString(); string month = (this.Month.Text).ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/LS_RCJJDDLFD.rdlc"); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", year); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", month); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); LSDAL dal = new LSDAL(); DataTable dt1 = dal.Get_LS_RCJJDDLFD(year, month); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_RCJJDDLFD", dt1)); DataTable dt2 = dal.Get_LS_RCJJDDLFDSum(year, month); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_RCJJDDLFDSum", dt2)); DataTable dt3 = dal.Get_LS_RCJJDDLFD_TuBiao(year, month); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_RCJJDDLFDTuBiao", dt3)); this.ReportViewer1.LocalReport.Refresh(); }
protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); //string acceptType = (this.HiddenForAcceptType.Value).ToString(); string acceptType = (this.HiddenForAcceptType.Value).ToString(); string callType = (this.HiddenForCallType.Value).ToString(); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/LS_SLJL.rdlc"); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); LSDAL dal = new LSDAL(); DataTable dt = dal.Get_LS_SLJL(start, end, acceptType,callType); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_SLJL", dt)); this.ReportViewer1.LocalReport.Refresh(); }
protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); string name = (this.Name.Text).ToString(); string workCode = (this.WorkCode.Text).ToString(); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/TJ_HJSJLY.rdlc"); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); TJDAL dal = new TJDAL(); DataTable dt = dal.Get_TJ_HJSJLY(start, end, name, workCode); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_HJSJLY", dt)); DataTable dt1 = dal.Get_TJ_HJSJLY_TL(start, end, name, workCode); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_HJSJLYTU", dt1)); this.ReportViewer1.LocalReport.Refresh(); }
protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); string center = (this.Center.Text).ToString(); string station = (this.Station.Text).ToString(); string name = (this.Name.Text).ToString(); string workCode = (this.WorkCode.Text).ToString(); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/TJ_JJRYGZXL.rdlc"); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); TJDAL dal = new TJDAL(); DataTable dt = dal.Get_JJRYGZXL(start, end, center, station, name, workCode); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JJRYGZXL", dt)); this.ReportViewer1.LocalReport.Refresh(); }
protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); string center = (this.Center.Text).ToString(); string station = (this.Station.Text).ToString(); string name = Convert.ToString(this.Name.Text); string workCode = Convert.ToString(this.WorkCode.Text); string carNumber = (this.CarNumber.Text).ToString(); int time = Convert.ToInt32(this.Time.Text); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/" + reportName); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); LSDAL dal = new LSDAL(); TJDAL dalt = new TJDAL(); switch (reportName) { case "LS_SJCCQK.rdlc": //司机出车大于5分钟流水表 DataTable dt = dal.Get_LS_SJCCQK(start, end, center, station, name, workCode, carNumber, time); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_SJCCQK", dt)); break; case "TJ_SJCCDY5FZ.rdlc": //司机出车大于5分钟统计表 DataTable dt1 = dalt.Get_SJCCDY5FZ(start, end, center, station, name, workCode, carNumber, time); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_SJCCDY5FZ", dt1)); break; default: break; } this.ReportViewer1.LocalReport.Refresh(); }
public ActionResult TestReportRendering() { ms.ReportParameter p1 = new ms.ReportParameter(); p1.Name = "ISO_ID"; p1.Values.Add("826"); ms.ReportParameter p2 = new ms.ReportParameter(); p2.Name = "LedgerPeriod"; p2.Values.Add("201202"); ms.ReportParameter p3 = new ms.ReportParameter(); p3.Name = "ho_id"; p3.Values.Add("0"); ms.ReportParameter p4 = new ms.ReportParameter(); p4.Name = "br_id"; p4.Values.Add("0"); HttpContext.Items[Strings.ReportPath] = "/Accounting/Agent_Chargeback_Details"; HttpContext.Items[Strings.ReportParameterList] = new List <ms.ReportParameter>(new ms.ReportParameter[] { p1, p2, p3, p4 }); return(PartialView("ViewReport")); }
protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); //string workState = (this.HiddenForStartWorkState.Value); string workState = (this.HiddenForStartWorkState.Value); string time = Convert.ToString(this.WorkStateTime.Text); string name = Convert.ToString(this.DispatcherName.Text); string personCode = Convert.ToString(this.WorkNumber.Text); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/" + reportName); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); LSDAL dal = new LSDAL(); TJDAL dalt = new TJDAL(); switch (reportName) { case "LS_DDYGZZT.rdlc": //调度员工作状态流水表 DataTable dt = dal.Get_LS_DDYGZZT(start, end, workState, time, name, personCode); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_DDYGZZT", dt)); break; case "TJ_DDYGZZT.rdlc": //调度员工作状态统计表 DataTable dt1 = dalt.Get_TJ_DDYGZZT(start, end, workState, name, personCode, time); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_DDYGZZT", dt1)); break; default: break; } this.ReportViewer1.LocalReport.Refresh(); }
protected void BindReportDataSource() { DateTime beginTime = Convert.ToDateTime(this.StartDate.Text); DateTime endTime = Convert.ToDateTime(this.EndDate.Text); string eventType = Convert.ToString(this.EventType.Text); string name = Convert.ToString(this.Name.Text); string centerID = Convert.ToString(this.Center.Text); string stationID = (this.Station.Text).ToString(); string diseasesClassification = (this.DiseasesClassification.Text).ToString(); string doctorAndNurse = Convert.ToString(this.DoctorAndNurse.Text); string driver = Convert.ToString(this.Driver.Text); string stretcher = Convert.ToString(this.Stretcher.Text); string alarmReason = Convert.ToString(this.AlarmReason.Text); string illnessClassification = Convert.ToString(this.IllnessClassification.Text); string illnessForecast = Convert.ToString(this.IllnessForecast.Text); string firstAidEffect = Convert.ToString(this.FirstAidEffect.Text); string diseaseCooperation = Convert.ToString(this.DiseaseCooperation.Text); string firstImpression = Convert.ToString(this.FirstImpression.Text); string deathCase = Convert.ToString(this.DeathCase.Text); string deathCertificate = Convert.ToString(this.DeathCertificate.Text); string treatmentMeasure = Convert.ToString(this.TreatmentMeasure.Text); string start1 = beginTime.ToString(); string end1 = endTime.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/LS_BL.rdlc"); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("startTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("endTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); LSDAL dal = new LSDAL(); DataTable dt = dal.Get_LS_BL(beginTime, endTime, eventType, name, centerID, stationID, diseasesClassification, doctorAndNurse, driver, stretcher, alarmReason, illnessClassification, illnessForecast, firstAidEffect, diseaseCooperation, firstImpression, deathCase, deathCertificate, treatmentMeasure); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_BL", dt)); this.ReportViewer1.LocalReport.Refresh(); }
protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); string time = Convert.ToString(this.Time.Text); //string result = Convert.ToString(this.HiddenForResult.Value); string result = Convert.ToString(this.HiddenForResult.Value); string name = (this.Name.Text).ToString(); string workCode = Convert.ToString(this.WorkCode.Text); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/TJ_WJLD.rdlc"); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); TJDAL dal = new TJDAL(); DataTable dt = dal.Get_WJLD(start, end, time, result, name, workCode); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_WJLD", dt)); DataTable dt1 = dal.Get_WJLD_Reason(start, end, time, result, name, workCode); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_WJLDSum", dt1)); this.ReportViewer1.LocalReport.Refresh(); }
public List<viewer.ReportParameter> GetReportParametersForSsrsReportViewer(CrcReportDefinition reptDefn) { var convertedParams = new List<viewer.ReportParameter>(); foreach (var paramDefn in reptDefn.ParameterDefinitions) { if (paramDefn.ParameterChoice != null) { var convParam = new viewer.ReportParameter(); convParam.Name = paramDefn.Name; if (!string.IsNullOrEmpty(paramDefn.ParameterChoice.SingleValue)) { foreach (var valLoop in paramDefn.ParameterChoice.Values) convParam.Values.Add(valLoop); } else { // we want to record a null convParam.Values.Add(null); } convertedParams.Add(convParam); } } return convertedParams; }
protected void RunInternational() { SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["connString"].ToString()); conn.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandText = "uspRptInternational"; cmd.CommandType = CommandType.StoredProcedure; if (Session["profilename"].ToString() == "Client") { cmd.Parameters.Add(new SqlParameter("@ClientId", Session["ClientId"].ToString())); } else { cmd.Parameters.Add(new SqlParameter("@ClientId", this.lstClient.SelectedValue.ToString())); } cmd.Parameters.Add(new SqlParameter("@StartDate", this.txtStartDate.Text)); cmd.Parameters.Add(new SqlParameter("@EndDate", this.txtEndDate.Text)); SqlDataReader dr = cmd.ExecuteReader(); dsInvoiceDetail dsDetail = new dsInvoiceDetail(); while (dr.Read()) { dsDetail.Tables[0].Rows.Add(dr[0].ToString(), System.Convert.ToDateTime(dr[1].ToString()), dr[2].ToString(), dr[3].ToString(), System.Convert.ToInt32(dr[4].ToString()), System.Convert.ToDouble(dr[5].ToString())); } dr.Close(); this.rptViewer.LocalReport.DataSources.Clear(); this.rptViewer.Reset(); Microsoft.Reporting.WebForms.ReportDataSource rdInvDetail = new Microsoft.Reporting.WebForms.ReportDataSource("dsInvoiceDetail", dsDetail.Tables[0]); this.rptViewer.LocalReport.DataSources.Add(rdInvDetail); this.rptViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; this.rptViewer.LocalReport.ReportPath = @"Reports\International.rdlc"; // Get the date range to show on the report var startDate = (from dta in dsDetail.Tables[0].AsEnumerable() orderby dta.Field <DateTime>("CallDate") ascending select(dta.Field <DateTime>("CallDate"))).FirstOrDefault(); var endDate = (from dta in dsDetail.Tables[0].AsEnumerable() orderby dta.Field <DateTime>("CallDate") ascending select(dta.Field <DateTime>("CallDate"))).LastOrDefault(); // Configure report params Microsoft.Reporting.WebForms.ReportParameter ClientDescription = null; if (Session["profilename"].ToString() == "Client") { ClientDescription = new Microsoft.Reporting.WebForms.ReportParameter("ClientDescription", Session["ClientDesc"].ToString()); } else { ClientDescription = new Microsoft.Reporting.WebForms.ReportParameter("ClientDescription", this.lstClient.SelectedItem.ToString()); } Microsoft.Reporting.WebForms.ReportParameter ReportDescription = new Microsoft.Reporting.WebForms.ReportParameter("ReportDescription", "From : " + startDate + Environment.NewLine + "To : " + endDate); this.rptViewer.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { ClientDescription, ReportDescription }); this.rptViewer.LocalReport.Refresh(); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { rv_PFcontribution.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = rv_PFcontribution.ServerReport; Microsoft.Reporting.WebForms.ReportParameter BusinessUnit; Microsoft.Reporting.WebForms.ReportParameter Period; Microsoft.Reporting.WebForms.ReportParameter Organisation; //Microsoft.Reporting.WebForms.ReportParameter Department; Microsoft.Reporting.WebForms.ReportParameter PeriodElement; string sDomain = System.Configuration.ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient Wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; serverReport.ReportPath = MyReportPath + "PROVIDENTFUND_CONTRIBUTION"; if (Convert.ToString(Request.QueryString["PRD"]) != "") { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", Convert.ToString(Request.QueryString["PRD"])); } else { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", "-1"); } if (Convert.ToString(Request.QueryString["PERIODELEMENT"]) != "") { PeriodElement = new Microsoft.Reporting.WebForms.ReportParameter("PeriodElement", Convert.ToString(Request.QueryString["PERIODELEMENT"])); } else { PeriodElement = new Microsoft.Reporting.WebForms.ReportParameter("PeriodElement", "-1"); } if (Convert.ToString(Request.QueryString["BU"]) != "") { BusinessUnit = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", Convert.ToString(Request.QueryString["BU"])); } else { BusinessUnit = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", "-1"); } //if (Convert.ToString(Request.QueryString["DEPT"]) != "") //{ // Department = new Microsoft.Reporting.WebForms.ReportParameter("Department", Convert.ToString(Request.QueryString["DEPT"])); //} //else //{ // Department = new Microsoft.Reporting.WebForms.ReportParameter("Department", "-1"); //} Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Session["ORG_ID"])); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Period, PeriodElement, BusinessUnit, Organisation }; serverReport.SetParameters(parameters); serverReport.Refresh(); rv_PFcontribution.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "PF_contributionReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void BindReportDataSource() { DateTime beginTime = Convert.ToDateTime(this.StartDate.Text); DateTime endTime = Convert.ToDateTime(this.EndDate.Text); string eventType = Convert.ToString(this.txtPatientVersion.Text); string txtCenter = Convert.ToString(this.Center.Text); string stationID = Convert.ToString(this.Station.Text); // string txtCenter = Convert.ToString(this.DropDownList_Center.SelectedValue); //// string txtCenter = Convert.ToString(DropDownList_Center.Text); // string stationID = Convert.ToString(this.DropDownList_Station.SelectedValue); string agentID = Convert.ToString(this.txtAgentWorkID.Text); string doctorAndNurse = Convert.ToString(this.txtDoctorAndNurse.Text); string txtDiseasesClassification = Convert.ToString(this.txtDiseasesClassification.Text); string txtIllnessClassification = Convert.ToString(this.txtIllnessClassification.Text); string txtDeathCase = Convert.ToString(this.txtDeathCase.Text); string txtMeasures = Convert.ToString(this.txtMeasures.Text); string txtFirstAidEffect = Convert.ToString(this.txtFirstAidEffect.Text); string txtFirstImpression = Convert.ToString(this.txtFirstImpression.Text); string txtSendAddress = Convert.ToString(this.txtSendAddress.Text); string start1 = beginTime.ToString(); string end1 = endTime.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/" + reportName); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); TJDAL dal = new TJDAL(); switch (reportName) { case "TJ_JZCS.rdlc": this.Page.Title = "救治措施统计表"; DataTable dt = dal.Get_TJ_JZCS(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JZCS", dt)); break; case "TJ_JJPF.rdlc": this.Page.Title = "急救评分统计表"; DataTable dt1 = dal.Get_TJ_JJPF(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JJPF", dt1)); break; case "TJ_BLZDSJ.rdlc": this.Page.Title = "出车数,病历数,重大事件数统计表"; DataTable dt2 = dal.Get_TJ_BLZDSJ(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_BLZDSJ", dt2)); break; case "TJ_BQFL.rdlc": this.Page.Title = "病情分类统计表"; DataTable dt3 = dal.Get_TJ_BQFL(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_BQFL", dt3)); break; case "TJ_JJXG.rdlc": this.Page.Title = "急救效果统计表"; DataTable dt4 = dal.Get_TJ_JJXG(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JJXG", dt4)); break; case "TJ_BQYB.rdlc": this.Page.Title = "病情预报统计表"; DataTable dt5 = dal.Get_TJ_BQYB(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_BQYB", dt5)); break; case "TJ_HZSW.rdlc": this.Page.Title = "患者死亡统计表"; DataTable dt6 = dal.Get_TJ_HZSW(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_HZSW", dt6)); break; case "TJ_HC.rdlc": this.Page.Title = "急救耗材统计表"; DataTable dt7 = dal.Get_TJ_HC(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_HC", dt7)); break; case "TJ_XB.rdlc": this.Page.Title = "性别统计表"; DataTable dt8 = dal.Get_TJ_XB(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_XB", dt8)); break; case "TJ_NLD.rdlc": this.Page.Title = "年龄段统计表"; DataTable dt9 = dal.Get_TJ_NLFB(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_NLDFB", dt9)); break; case "TJ_SJLX.rdlc": this.Page.Title = "事件类型统计表"; DataTable dt10 = dal.Get_TJ_SJLX(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_SJLX", dt10)); break; case "TJ_BZFL.rdlc": this.Page.Title = "病种分类统计表"; DataTable dt11 = dal.Get_TJ_BZFL(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_BZFL", dt11)); break; case "TJ_QXJC.rdlc": this.Page.Title = "器械检查统计表"; DataTable dt12 = dal.Get_TJ_QXJC(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_QXJC", dt12)); break; case "TJ_YPYYL.rdlc": this.Page.Title = "药品用药量统计表"; DataTable dt13 = dal.Get_TJ_YPYYL(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_YPYYL", dt13)); break; case "TJ_JJZLJC.rdlc": this.Page.Title = "拒绝治疗、体检、器械检查、提供病史统计表"; DataTable dt14 = dal.Get_TJ_JJZLJC(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JJZLJC", dt14)); break; case "TJ_HJYY.rdlc": this.Page.Title = "呼救医院统计表"; DataTable dt15 = dal.Get_TJ_HJYY(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_HJYY", dt15)); break; case "TJ_SDYY.rdlc": this.Page.Title = "送达医院统计表"; DataTable dt16 = dal.Get_TJ_SDYY(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_SDYY", dt16)); break; case "TJ_RWLX.rdlc": this.Page.Title = "任务类型统计表"; DataTable dt17 = dal.Get_TJ_RWLX(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_RWLX", dt17)); break; case "TJ_HF.rdlc": this.Page.Title = "回访统计表"; DataTable dt18 = dal.Get_TJ_HF(beginTime, endTime, eventType, stationID, agentID, doctorAndNurse, txtCenter, txtDiseasesClassification, txtIllnessClassification, txtDeathCase, txtMeasures, txtFirstAidEffect, txtFirstImpression, txtSendAddress); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_HF", dt18)); break; default: break; } this.ReportViewer1.LocalReport.Refresh(); }
private void RetrieveFieldsDetailPDF1() { string mlTANGGAL = ""; string mlRECEIVEDCODE = ""; string mlRECEIVEDBY = ""; Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; string filename = ""; string deviceInfo = "<DeviceInfo>" + " <OutputFormat>EMF</OutputFormat>" + " <PageWidth>8.27in</PageWidth>" + " <PageHeight>11.69in</PageHeight>" + " <MarginTop>0.7874in</MarginTop>" + " <MarginLeft>0.98425in</MarginLeft>" + " <MarginRight>0.98425in</MarginRight>" + " <MarginBottom>0.7874in</MarginBottom>" + "</DeviceInfo>"; mlDATATABLE = (DataTable)Session["FormEditReceiptData"]; mlTANGGAL = FormatDateyyyyMMdd(Convert.ToDateTime(mlDATATABLE.Rows[0]["InvPreparedForDate"])); mlRECEIVEDCODE = mlDATATABLE.Rows[0]["InvCodeMess"].ToString(); mlRECEIVEDBY = mlDATATABLE.Rows[0]["InvMessName"].ToString(); if (mlDATATABLE.Rows[0]["InvStatus"].ToString() == "PROCEEDS" && mlDATATABLE.Rows[0]["InvReceiptFlag"].ToString() == "R") { mlSQL2 = "SELECT * FROM INV_DELIVERY " + "WHERE Disabled = 0 AND InvReceiptFlag = 'R' AND InvPreparedForDate = '" + mlTANGGAL + "' AND InvCodeMess = '" + mlRECEIVEDCODE + "' AND InvMessName = '" + mlRECEIVEDBY + "' " + "ORDER BY InvPreparedForDate Desc"; mlREADER2 = mlOBJGS.DbRecordset(mlSQL2, "PB", mlCOMPANYID); mlDATATABLE1 = InsertReaderToDatatable(mlDATATABLE1, mlDATAROW, mlREADER2); } ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/pj_delinv/InvReceiptH.rdlc"); Microsoft.Reporting.WebForms.ReportParameter mlRECEIPTCODE = new Microsoft.Reporting.WebForms.ReportParameter("ReceiptCode", mlDATATABLE.Rows[0]["InvReceiptCode"].ToString()); Microsoft.Reporting.WebForms.ReportParameter mlCODEMESS = new Microsoft.Reporting.WebForms.ReportParameter("CodeMess", mlDATATABLE.Rows[0]["InvCodeMess"].ToString()); Microsoft.Reporting.WebForms.ReportParameter mlCOMPNAME = new Microsoft.Reporting.WebForms.ReportParameter("CompanyName", mlCOMPANYNAME); Microsoft.Reporting.WebForms.ReportParameter mlCOMPADDR = new Microsoft.Reporting.WebForms.ReportParameter("CompanyAddress", mlCOMPANYADDRESS); Microsoft.Reporting.WebForms.ReportParameter mlTITLE = new Microsoft.Reporting.WebForms.ReportParameter("Title", "INVOICE / RECEIPT"); Microsoft.Reporting.WebForms.ReportDataSource mlDATASOURCE = new Microsoft.Reporting.WebForms.ReportDataSource(); Microsoft.Reporting.WebForms.LocalReport mlREPORTH = new Microsoft.Reporting.WebForms.LocalReport(); mlDATASOURCE.Name = "INV_RECEIPT_DATAH"; mlDATASOURCE.Value = mlDATATABLE; mlREPORTH.ReportEmbeddedResource = "~/pj_delinv/InvReceiptH.rdlc"; mlREPORTH.DataSources.Add(mlDATASOURCE); ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SetSubDataSource); ReportViewer1.LocalReport.ReportEmbeddedResource = mlREPORTH.ReportEmbeddedResource; ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(mlDATASOURCE); ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { mlRECEIPTCODE, mlCODEMESS, mlCOMPNAME, mlCOMPADDR, mlTITLE }); //byte[] bytes = ReportViewer1.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); byte[] bytes = ReportViewer1.LocalReport.Render("PDF", deviceInfo, out mimeType, out encoding, out extension, out streamIds, out warnings); string path = Server.MapPath("~/pj_delinv/Print_Files"); // Open PDF File in Web Browser filename = "InvReceipt"; extension = "pdf"; FileStream file = new FileStream(path + "/" + filename + "." + extension, FileMode.OpenOrCreate, FileAccess.ReadWrite); file.Write(bytes, 0, bytes.Length); file.Dispose(); WebClient client = new WebClient(); Byte[] buffer = client.DownloadData(path + "/" + filename + "." + extension); if (buffer != null) { Response.ContentType = "application/pdf"; Response.AddHeader("content-length", buffer.Length.ToString()); Response.BinaryWrite(buffer); } }
private void RetrieveFieldsDetailPDF() { string mlTANGGAL = ""; string mlRECEIVEDCODE = ""; string mlRECEIVEDBY = ""; Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; string filename = ""; mlDATATABLE = (DataTable)Session["FormEditReceiptData"]; mlTANGGAL = FormatDateyyyyMMdd(Convert.ToDateTime(mlDATATABLE.Rows[0]["InvPreparedForDate"])); mlRECEIVEDCODE = mlDATATABLE.Rows[0]["InvCodeMess"].ToString(); mlRECEIVEDBY = mlDATATABLE.Rows[0]["InvMessName"].ToString(); if (mlDATATABLE.Rows[0]["InvStatus"].ToString() == "PROCEEDS" && mlDATATABLE.Rows[0]["InvReceiptFlag"].ToString() == "R") { mlSQL2 = "SELECT * FROM INV_DELIVERY " + "WHERE Disabled = 0 AND InvReceiptFlag = 'R' AND InvReceiptCode = '" + mlDATATABLE.Rows[0]["InvReceiptCode"].ToString() + "'" + " AND InvPreparedForDate = '" + mlTANGGAL + "' AND InvCodeMess = '" + mlRECEIVEDCODE + "' AND InvMessName = '" + mlRECEIVEDBY + "' " + "ORDER BY InvPreparedForDate Desc"; mlREADER2 = mlOBJGS.DbRecordset(mlSQL2, "PB", mlCOMPANYID); mlDATATABLE1 = InsertReaderToDatatable(mlDATATABLE1, mlDATAROW, mlREADER2); } ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/pj_delinv/InvReceiptH.rdlc"); Microsoft.Reporting.WebForms.ReportParameter mlRECEIPTCODE = new Microsoft.Reporting.WebForms.ReportParameter("ReceiptCode", mlDATATABLE.Rows[0]["InvReceiptCode"].ToString()); Microsoft.Reporting.WebForms.ReportParameter mlCODEMESS = new Microsoft.Reporting.WebForms.ReportParameter("CodeMess", mlDATATABLE.Rows[0]["InvCodeMess"].ToString()); Microsoft.Reporting.WebForms.ReportParameter mlCOMPNAME = new Microsoft.Reporting.WebForms.ReportParameter("CompanyName", mlCOMPANYNAME); Microsoft.Reporting.WebForms.ReportParameter mlCOMPADDR = new Microsoft.Reporting.WebForms.ReportParameter("CompanyAddress", mlCOMPANYADDRESS); Microsoft.Reporting.WebForms.ReportParameter mlTITLE = new Microsoft.Reporting.WebForms.ReportParameter("Title", "INVOICE / RECEIPT"); Microsoft.Reporting.WebForms.ReportDataSource mlDATASOURCE = new Microsoft.Reporting.WebForms.ReportDataSource(); Microsoft.Reporting.WebForms.LocalReport mlREPORTH = new Microsoft.Reporting.WebForms.LocalReport(); mlDATASOURCE.Name = "INV_RECEIPT_DATAH"; mlDATASOURCE.Value = mlDATATABLE; mlREPORTH.ReportEmbeddedResource = "~/pj_delinv/InvReceiptH.rdlc"; mlREPORTH.DataSources.Add(mlDATASOURCE); ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SetSubDataSource); ReportViewer1.LocalReport.ReportEmbeddedResource = mlREPORTH.ReportEmbeddedResource; ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(mlDATASOURCE); ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { mlRECEIPTCODE, mlCODEMESS, mlCOMPNAME, mlCOMPADDR, mlTITLE }); byte[] bytes = ReportViewer1.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); filename = "InvReceipt"; extension = "pdf"; // Now that you have all the bytes representing the PDF report, buffer it and send it to the client. Response.Buffer = true; Response.Clear(); Response.ContentType = mimeType; Response.AddHeader("content-disposition", "attachment; filename=" + filename + "." + extension); Response.BinaryWrite(bytes); // create the file Response.Flush(); // send it to the client to download Response.End(); //Body.Size.Width + Report.Margins.Left + Report.Margins.Right <= Report.PageSize.Width }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { RPT_SalarySlip.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_SalarySlip.ServerReport; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter BusinessGroup; Microsoft.Reporting.WebForms.ReportParameter Employee; Microsoft.Reporting.WebForms.ReportParameter Period; Microsoft.Reporting.WebForms.ReportParameter PeriodDetails; string sDomain = ConfigurationSettings.AppSettings["MyReportViewerDomain"]; string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; WebClient wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string Report_Name = string.Empty; if (Convert.ToString(Request.QueryString["Localisation"]) == "AUSTRALIA") { Report_Name = "SalarySlip_Australia"; } else if (Convert.ToString(Request.QueryString["Localisation"]) == "INDIA") { Report_Name = "SalarySlip"; } else { Report_Name = "SalarySlip_Kenya"; } serverReport.ReportPath = MyReportPath + Report_Name; if (Convert.ToString(Request.QueryString["PRD"]) != "") { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", Convert.ToString(Request.QueryString["PRD"])); } else { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", "-1"); } if (Convert.ToString(Request.QueryString["PRDDTL"]) != "") { PeriodDetails = new Microsoft.Reporting.WebForms.ReportParameter("PeriodElement", Convert.ToString(Request.QueryString["PRDDTL"])); } else { PeriodDetails = new Microsoft.Reporting.WebForms.ReportParameter("PeriodElement", "-1"); } if (Convert.ToString(Request.QueryString["EMP"]) != "") { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", Convert.ToString(Request.QueryString["EMP"])); } else { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", "-1"); } if (Convert.ToString(Request.QueryString["BU"]) != "") { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", Convert.ToString(Request.QueryString["BU"])); } else { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", "-1"); } Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Session["ORG_ID"])); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, BusinessGroup, Employee, Period, PeriodDetails }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_SalarySlip.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "SalarySlipReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { RPT_Ec.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_Ec.ServerReport; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter BusinessGroup; //Microsoft.Reporting.WebForms.ReportParameter Department; Microsoft.Reporting.WebForms.ReportParameter Period; Microsoft.Reporting.WebForms.ReportParameter PeriodElement; Microsoft.Reporting.WebForms.ReportParameter Employee; /////// Microsoft.Reporting.WebForms.ReportParameter Status; string sDomain = ConfigurationSettings.AppSettings["MyReportViewerDomain"]; string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; WebClient wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); if (Convert.ToString(Session["frm"]) == "edu") { serverReport.ReportPath = MyReportPath + "EducationClaimBalanceReport"; } else { serverReport.ReportPath = MyReportPath + "MedicalClaimReport"; } if (Convert.ToString(Request.QueryString["BU"]) != "") { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("EMPBUSINESSUNITID", Convert.ToString(Request.QueryString["BU"])); } else { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("EMPBUSINESSUNITID", "-1"); } //if (Convert.ToString(Request.QueryString["EMP"]) != "") //{ // Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", Convert.ToString(Request.QueryString["EMP"])); //} //else //{ // Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", "-1"); //} //if (Convert.ToString(Request.QueryString["ORG"]) != "") //{ // Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Request.QueryString["ORG"])); //} //else //{ // Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", "-1"); //} if (Convert.ToString(Request.QueryString["Emp"]) != "") { Employee = new Microsoft.Reporting.WebForms.ReportParameter("EMPID", Convert.ToString(Request.QueryString["Emp"])); } else { Employee = new Microsoft.Reporting.WebForms.ReportParameter("EMPID", "-1"); } if (Convert.ToString(Request.QueryString["PRD"]) != "") { Period = new Microsoft.Reporting.WebForms.ReportParameter("EDUPERIODID", Convert.ToString(Request.QueryString["PRD"])); } else { Period = new Microsoft.Reporting.WebForms.ReportParameter("EDUPERIODID", "-1"); } if (Convert.ToString(Request.QueryString["PRDDTL"]) != "") { PeriodElement = new Microsoft.Reporting.WebForms.ReportParameter("PRDDTLID", Convert.ToString(Request.QueryString["PRDDTL"])); } else { PeriodElement = new Microsoft.Reporting.WebForms.ReportParameter("PRDDTLID", "-1"); } //Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Session["ORG_ID"])); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { BusinessGroup, Employee, Period, PeriodElement }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_Ec.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "SpouseReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/" + reportName); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); LSDAL dal = new LSDAL(); TJDAL dalt = new TJDAL(); switch (reportName) { case "LS_ZDTFXZHSG.rdlc": //重大突发性灾害事故流水表 this.Page.Title = "重大突发性灾害事故流水表"; DataTable dt = dal.Get_LS_ZDTFXZHSG(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_ZDTFXZHSG", dt)); break; case "LS_DDRZ.rdlc": //调度日志流水表 this.Page.Title = "调度日志流水表"; DataTable dt1 = dal.Get_LS_DDRZ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_DDRZ", dt1)); break; case "LS_FSTZ.rdlc": //发送通知流水表 this.Page.Title = "发送通知流水表"; DataTable dt2 = dal.Get_LS_FSTZ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_FSTZ", dt2)); break; case "LS_RCJJDDLFDSJD.rdlc": //日常急救到达率分段(时间段)表 this.Page.Title = "日常急救到达率分段(时间段)表"; DataTable dt3 = dal.Get_LS_RCJJDDLFDSJD(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_RCJJDDLFDSJD", dt3)); DataTable dte = dal.Get_LS_RCJJDDLFDSJDSum(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_RCJJDDLFDSJDSum", dte)); break; case "LS_SJDWCGL.rdlc": //手机定位成功率统计表 this.Page.Title = "手机定位成功率统计表"; DataTable dt4 = dal.Get_LS_SJDWCGL(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_SJDWCGL", dt4)); break; case "LS_WZBRBQYBDJ.rdlc": //危重病人病情预报登记表 this.Page.Title = "危重病人病情预报登记表"; DataTable dt5 = dal.Get_LS_WZBRBQYBDJ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_WZBRBQYBDJ", dt5)); break; case "LS_YYGZDJ.rdlc": //医院搁置担架统计表 this.Page.Title = "医院搁置担架统计表"; DataTable dt6 = dal.Get_LS_YYGZDJ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_YYGZDJ", dt6)); break; case "LS_YYGZJHCDJYXCC.rdlc": //医院搁置救护车担架影响出车统计表 this.Page.Title = "医院搁置救护车担架影响出车统计表"; DataTable dt7 = dal.Get_LS_YYGZJHCDJYXCC(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_YYGZJHCDJYXCC", dt7)); break; case "TJ_CCCSFD.rdlc": //出车次数分段统计表 this.Page.Title = "出车次数分段统计表"; DataTable dt8 = dalt.Get_TJ_CCCSFD(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_CCCSFD", dt8)); break; case "TJ_CCQK.rdlc": //出车情况统计表 this.Page.Title = "出车情况统计表"; DataTable dt9 = dalt.Get_TJ_CCQK(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_CCQK", dt9)); break; case "TJ_DDYGZL.rdlc": //调度员工作量统计表 this.Page.Title = "调度员工作量统计表"; DataTable dt10 = dalt.Get_TJ_DDYGZL(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_DDYGZL", dt10)); break; case "TJ_DDYGZL2.rdlc": //调度员工作量统计表(二) this.Page.Title = "调度员工作量统计表(二)"; DataTable dt11 = dalt.Get_TJ_DDYGZL2(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_DDYGZL2", dt11)); break; case "TJ_DDYGZXL.rdlc": //调度员工作效率统计表 this.Page.Title = "调度员工作效率统计表"; DataTable dt12 = dalt.Get_TJ_DDYGZXL(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_DDYGZXL", dt12)); break; case "TJ_DJJ.rdlc": //对讲机统计表 this.Page.Title = "对讲机统计表"; DataTable dt13 = dalt.Get_TJ_DJJ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_DJJ", dt13)); break; case "TJ_FCQKMX2.rdlc": //放车情况明细统计表(二) this.Page.Title = "放车情况明细统计表(二)"; DataTable dt14 = dalt.Get_TJ_FCQKMX2(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FCQKMX2", dt14)); break; case "TJ_FCQKMX1.rdlc": //放车情况明细统计表(一) this.Page.Title = "放车情况明细统计表(一)"; DataTable dt15 = dalt.Get_TJ_FCQKMX1(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FCQKMX1", dt15)); DataTable dt16 = dalt.Get_TJ_FCQKMX1BT1(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FCQKMX1_BING1", dt16)); DataTable dt17 = dalt.Get_TJ_FCQKMX1BT2(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FCQKMX1_BING2", dt17)); DataTable dt18 = dalt.Get_TJ_FCQKMX1ZX(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FCQKMX1_ZHEXIAN1", dt18)); break; case "TJ_FCYQYSJGX.rdlc": //放车与区域时间关系统计表 this.Page.Title = "放车与区域时间关系统计表"; DataTable dt19 = dalt.Get_TJ_FCYQYSJGX(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FCYQYSJGX", dt19)); break; case "TJ_FZXBGFSXB.rdlc": //分中心上下班问题统计表 this.Page.Title = "分中心上下班问题统计表"; DataTable dt20 = dalt.Get_TJ_FZXSXBWT(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FZXBGFSXB", dt20)); break; case "TJ_FZXZTDY.rdlc": //分中心暂停调用统计表 this.Page.Title = "分中心暂停调用统计表"; DataTable dt21 = dalt.Get_TJ_FZXZTDY(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FZXZTDY", dt21)); break; case "TJ_HJBZQK.rdlc": //呼病种情况统计表 this.Page.Title = "呼病种情况统计表"; DataTable dt22 = dalt.Get_TJ_HJBZQK(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_HJBZQK", dt22)); DataTable dt23 = dalt.Get_TJ_HJBZQK_XBYJB(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_HJBZQK_XBYJB", dt23)); DataTable dt24 = dalt.Get_TJ_HJBZQK_NLYJB(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_HJBZQK_NLYJB", dt24)); break; case "TJ_HJDHPDFZ.rdlc": //呼救电话排队峰值统计表 this.Page.Title = "呼救电话排队峰值统计表"; DataTable dt25 = dalt.Get_TJ_HJDHPDFZ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetFor_TJ_HJDHPDFZ", dt25)); break; case "TJ_HCYQYSJGX.rdlc": //回车与区域时间关系统计表 this.Page.Title = "回车与区域时间关系统计表"; DataTable dt26 = dalt.Get_TJ_HCYQYSJGX(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_HCYQYSJGX", dt26)); break; case "TJ_JJFYSJRB.rdlc": //急救反应时间(日报)统计表 this.Page.Title = "急救反应时间(日报)统计表"; DataTable dt27 = dalt.Get_TJ_JJFYSJRB(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JJFYSJRB", dt27)); DataTable dt28 = dalt.Get_TJ_JJFYSJRB1(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JJFYSJRB1", dt28)); DataTable dt29 = dalt.Get_TJ_JJFYSJRB2(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JJFYSJRB2", dt29)); DataTable dt30 = dalt.Get_TJ_JJFYSJRB_CenterTime(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JJFYSJRB_CenterTime", dt30)); break; case "TJ_JBYSJGX.rdlc": //疾病与时间关系统计表 this.Page.Title = "疾病与时间关系统计表"; DataTable dt32 = dalt.Get_TJ_JBYSJGX(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JBYSJGX", dt32)); break; case "TJ_RJRCCCSFB.rdlc": //人均日出车次数分布统计表 this.Page.Title = "人均日出车次数分布统计表"; DataTable dt33 = dalt.Get_TJ_RJRCCCSFB(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_RJRCCCSFB", dt33)); break; case "TJ_SWDDLX.rdlc": //送往地点类型统计表 this.Page.Title = "送往地点类型统计表"; DataTable dt34 = dalt.Get_TJ_SWDDLX(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_SWDDLX", dt34)); break; case "TJ_SWDD.rdlc": //送往地点统计表 this.Page.Title = "送往地点统计表"; DataTable dt35 = dalt.Get_TJ_SWDD(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_SWDD", dt35)); break; case "TJ_WZBRBQYBDJ.rdlc": //危重病人病情预报登记统计表 this.Page.Title = "危重病人病情预报登记统计表"; DataTable dt36 = dalt.Get_TJ_WZBRBQYBDJ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_WZBRBQYBDJ", dt36)); break; case "TJ_WJSFCSJFX.rdlc": //未及时放车时间分析表 this.Page.Title = "未及时放车时间分析表"; DataTable dt37 = dalt.Get_TJ_WJSFCSJFX(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_WJSFCSJFX", dt37)); break; case "TJ_XCDD.rdlc": //现场地点统计表 this.Page.Title = "现场地点统计表"; DataTable dt38 = dalt.Get_TJ_XCDD(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_XCDD", dt38)); break; case "TJ_ZFZXCS.rdlc": //转分中心次数统计表 this.Page.Title = "转分中心次数统计表"; DataTable dt39 = dalt.Get_TJ_ZFZXCS(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_ZFZXCS", dt39)); break; case "TJ_ZYSJ.rdlc": //转院数据统计表 this.Page.Title = "转院数据统计表"; DataTable dt40 = dalt.Get_TJ_ZYSJ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_ZYSJ", dt40)); break; default: break; } this.ReportViewer1.LocalReport.Refresh(); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { TurnOverRateByDepartmentIntermsofAmount.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = TurnOverRateByDepartmentIntermsofAmount.ServerReport; Microsoft.Reporting.WebForms.ReportParameter BusinessGroup; Microsoft.Reporting.WebForms.ReportParameter FromDate; Microsoft.Reporting.WebForms.ReportParameter ToDate; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter Department; string sDomain = System.Configuration.ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient Wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; serverReport.ReportPath = MyReportPath + "TurnOverRateByDepartmentIntermsofAmount"; if (Convert.ToString(Request.QueryString["DEPT"]) != "") { Department = new Microsoft.Reporting.WebForms.ReportParameter("Department", Convert.ToString(Request.QueryString["DEPT"])); } else { Department = new Microsoft.Reporting.WebForms.ReportParameter("Department", "-1"); } if (Convert.ToString(Request.QueryString["BU"]) != "") { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", Convert.ToString(Request.QueryString["BU"])); } else { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", "-1"); } if (Convert.ToString(Request.QueryString["PRD"]) != "") { FromDate = new Microsoft.Reporting.WebForms.ReportParameter("FromDate", Convert.ToString(Request.QueryString["PRD"])); } else { FromDate = new Microsoft.Reporting.WebForms.ReportParameter("FromDate", "-1"); } if (Convert.ToString(Request.QueryString["PRD1"]) != "") { ToDate = new Microsoft.Reporting.WebForms.ReportParameter("ToDate", Convert.ToString(Request.QueryString["PRD1"])); } else { ToDate = new Microsoft.Reporting.WebForms.ReportParameter("ToDate", "-1"); } Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Session["ORG_ID"])); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, FromDate, ToDate, BusinessGroup, Department }; serverReport.SetParameters(parameters); serverReport.Refresh(); TurnOverRateByDepartmentIntermsofAmount.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "TurnOverRateAmountReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { //Le indicamos al Control que la invocación del reporte será de modo remoto ReportViewer1.ProcessingMode = ProcessingMode.Remote; if (Request.QueryString["JM"] != null) { ReportViewer1.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings.Get("WebReportingServiceJM")); } else { ReportViewer1.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings.Get("WebReportingService")); } ReportViewer1.ServerReport.ReportServerCredentials = new ReportingCredentials.ReportServerCredentials (ConfigurationManager.AppSettings.Get("CredencialesUser"), ConfigurationManager.AppSettings.Get("CredencialesPassword"), ConfigurationManager.AppSettings.Get("CredencialesDomain")); string lNombreReporte = Request.QueryString["sr"]; string _PathReportes = string.Format(@"/{0}/{1}", Request.QueryString["JM"] != null ? ConfigurationManager.AppSettings.Get("PathReportesJM") : ConfigurationManager.AppSettings.Get("PathReportes"), lNombreReporte); ReportViewer1.ServerReport.ReportPath = _PathReportes; ReportViewer1.Page.Culture = ConfigurationManager.AppSettings.Get("Cultura"); if (Request.QueryString["ci"] != null) { int lCantParametros = Convert.ToInt32(Request.QueryString["ci"].ToString()); string parametros = ""; for (int x = 0; x < lCantParametros; x++) { Microsoft.Reporting.WebForms.ReportParameter parametro = new Microsoft.Reporting.WebForms.ReportParameter(); //Definimos los parámetros parametro.Name = Request.QueryString["n" + x.ToString()]; parametro.Values.Add(Request.QueryString["v" + x.ToString()]);//txtContactID.Text parametros += Request.QueryString["v" + x.ToString()] + " ----- "; //Aqui le indicaremos si queremos que el parámetro //sea visible para el usuario o no parametro.Visible = false; //Crearemos un arreglo de parámetros Microsoft.Reporting.WebForms.ReportParameter[] rp = { parametro }; ReportViewer1.ServerReport.SetParameters(rp); } } //Warning[] warnings = null; //string[] streamids = null; //string mimeType = null; //string encoding = null; //string extension = null; byte[] result; //result = ReportViewer1.ServerReport.Render("PDF", null, PageCountMode.Estimate, out mimeType, out encoding, out extension, out streamids, out warnings); result = ReportViewer1.ServerReport.Render("PDF"); var ms = new MemoryStream(result); Response.Clear(); Response.ContentType = "application/pdf"; Response.BinaryWrite(ms.ToArray()); Response.Flush(); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { try { log.Info("Page load Started"); if (!IsPostBack && HiddenField1.Value != "loaded") { log.Info("Page load 3"); string param = Request.QueryString["rp"]; string export = Request.QueryString["export"]; Guid requestID = new Guid(Request.QueryString["r"]); /*var data = getResponse(requestID.ToString()); * log.Info("Page load 4" + data); * if (data == "") return; * JObject jsonObj = JObject.Parse(data); * string fileName = jsonObj["FileName"].Value<string>();*/ string fileName = getResponseSQL(requestID.ToString()); if (fileName == null || fileName == "") { fileName = ""; } string userid = Request.QueryString["userid"]; if (userid == null || userid == "") { userid = "0"; } log.Info("Page load 5" + userid); string reportServerUser = ConfigurationManager.AppSettings["ReportServerUser"]; string reportServerPassword = ConfigurationManager.AppSettings["ReportServerPassword"]; string reportServerDomain = ConfigurationManager.AppSettings["ReportServerDomain"]; string reportPath = ConfigurationManager.AppSettings["ReportServerPath"]; log.Info("Page load 6" + reportPath); IReportServerCredentials irsc = new CustomReportCredentials(reportServerUser, reportServerPassword, reportServerDomain); log.Info("Page load 7" + irsc.ToString()); mainReportViewer.ServerReport.ReportServerCredentials = irsc; mainReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportServerUrl"]); mainReportViewer.ServerReport.ReportPath = string.Format(ConfigurationManager.AppSettings["ReportPath"], reportPath.Substring(1) + "/" + fileName); mainReportViewer.ProcessingMode = ProcessingMode.Remote; log.Info("Page load 8" + mainReportViewer.ServerReport.ReportPath.ToString()); // Set the report parameters for the report if (param != null) { Dictionary <string, string> reportParams = JsonConvert.DeserializeObject <Dictionary <string, string> >(param); if (reportParams.Count > 0) { ReportParameter[] reportParameter = new ReportParameter[reportParams.Count]; int iLoop = 0; foreach (var para in reportParams) { reportParameter[iLoop] = new ReportParameter(para.Key.ToString(), para.Value.ToString()); iLoop++; } if (iLoop > 0) { mainReportViewer.ServerReport.SetParameters(reportParameter); } log.Info("Page load 9" + iLoop); } } try { mainReportViewer.ServerReport.SetParameters(new ReportParameter("path", reportPath)); mainReportViewer.ServerReport.SetParameters(new ReportParameter("pam_UserId", userid)); } catch (Exception exc) { log.Error(exc.Message, exc); } mainReportViewer.ServerReport.Refresh(); HiddenField1.Value = "loaded"; if (export == "true") { string title = Request.QueryString["title"]; CreateWord(mainReportViewer, title); } } } catch (Exception exc) { log.Error(exc.Message, exc); } }
private void RetrieveFieldsDetailLocal() { string mlCRITERIA = ""; string mlTANGGALFROM = ""; string mlTANGGALTO = ""; mlTANGGALFROM = FormatDateyyyyMMdd(mlTXTTANGGALFROM.Text); mlTANGGALTO = FormatDateyyyyMMdd(mlTXTTANGGALTO.Text); if ((mlTANGGALFROM != "") || (mlTANGGALTO != "")) { mlCRITERIA = "((PROCEEDSDATE BETWEEN '" + mlTANGGALFROM + "' AND '" + mlTANGGALTO + "') OR (DELIVEREDDATE BETWEEN '" + mlTANGGALFROM + "' AND '" + mlTANGGALTO + "') " + "OR (RETURNEDDATE BETWEEN '" + mlTANGGALFROM + "' AND '" + mlTANGGALTO + "') OR (DONEDATE BETWEEN '" + mlTANGGALFROM + "' AND '" + mlTANGGALTO + "')) "; } if (mlDDLREPORTNAME.SelectedItem.Value != "InvDeliverySummary.rdlc") { if (mlDDLBRANCH.SelectedItem.Value != "-- Pilih --") { mlCRITERIA = mlCRITERIA + " AND BRANCH = '" + mlDDLBRANCH.SelectedItem.Value + "'"; } mlSQL2 = "SELECT * FROM INV_DELIVERY_STATUS_BRANCH " + "WHERE " + mlCRITERIA + ""; mlREADER2 = mlOBJGS.DbRecordset(mlSQL2, "PB", mlCOMPANYID); mlDATATABLE = InsertReaderToDatatable(mlDATATABLE, mlDATAROW, mlREADER2); } else { mlSQL2 = "SELECT * FROM INV_DELIVERY_STATUS " + "WHERE " + mlCRITERIA + ""; mlREADER2 = mlOBJGS.DbRecordset(mlSQL2, "PB", mlCOMPANYID); mlDATATABLE = InsertReaderToDatatable(mlDATATABLE, mlDATAROW, mlREADER2); } ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/pj_delinv/" + mlDDLREPORTNAME.SelectedItem.Value + ""); Microsoft.Reporting.WebForms.ReportParameter mlCOMPNAME = new Microsoft.Reporting.WebForms.ReportParameter("CompanyName", mlCOMPANYNAME); Microsoft.Reporting.WebForms.ReportParameter mlCOMPADDR = new Microsoft.Reporting.WebForms.ReportParameter("CompanyAddress", mlCOMPANYADDRESS); Microsoft.Reporting.WebForms.ReportParameter mlTITLE = new Microsoft.Reporting.WebForms.ReportParameter("Title", "REPORTING MONITORING DELIVERY INVOICE"); //Microsoft.Reporting.WebForms.ReportDataSource mlDATASOURCE = new Microsoft.Reporting.WebForms.ReportDataSource("INV_RECEIPT_DATAH", mlDATATABLE); Microsoft.Reporting.WebForms.ReportDataSource mlDATASOURCE = new Microsoft.Reporting.WebForms.ReportDataSource(); Microsoft.Reporting.WebForms.LocalReport mlREPORTH = new Microsoft.Reporting.WebForms.LocalReport(); if (mlDDLREPORTNAME.SelectedItem.Value != "InvDeliverySummary.rdlc") { mlDATASOURCE.Name = "INV_DELIVERY_STATUSBRANCH"; } else { mlDATASOURCE.Name = "INV_DELIVERY_STATUS"; } mlDATASOURCE.Value = mlDATATABLE; mlREPORTH.ReportEmbeddedResource = "~/pj_delinv/" + mlDDLREPORTNAME.SelectedItem.Value + ""; mlREPORTH.DataSources.Add(mlDATASOURCE); //ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SetSubDataSource); ReportViewer1.LocalReport.ReportEmbeddedResource = mlREPORTH.ReportEmbeddedResource; ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(mlDATASOURCE); ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { mlCOMPNAME, mlCOMPADDR, mlTITLE }); ReportViewer1.LocalReport.Refresh(); }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_Nhif.ServerReport; Microsoft.Reporting.WebForms.ReportParameter BusinessUnit; Microsoft.Reporting.WebForms.ReportParameter Period; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter Department; Microsoft.Reporting.WebForms.ReportParameter Directorate; Microsoft.Reporting.WebForms.ReportParameter PeriodDetail; Microsoft.Reporting.WebForms.ReportParameter SubDepartment; Microsoft.Reporting.WebForms.ReportParameter Status; string sDomain = System.Configuration.ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient Wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; serverReport.ReportPath = MyReportPath + "NHIF Report"; //"NHIF_Report11"; if (Request.QueryString["BU"] != "") { BusinessUnit = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", Convert.ToString(Request.QueryString["BU"])); } else { BusinessUnit = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", "-1"); } if (Request.QueryString["DIR"] != "") { Directorate = new Microsoft.Reporting.WebForms.ReportParameter("Directorate", Convert.ToString(Request.QueryString["DIR"])); } else { Directorate = new Microsoft.Reporting.WebForms.ReportParameter("Directorate", "-1"); } if (Request.QueryString["DEPT"] != "") { Department = new Microsoft.Reporting.WebForms.ReportParameter("Department", Convert.ToString(Request.QueryString["DEPT"])); } else { Department = new Microsoft.Reporting.WebForms.ReportParameter("Department", "-1"); } if (Request.QueryString["PRD"] != "") { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", Convert.ToString(Request.QueryString["PRD"])); } else { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", "-1"); } if (Request.QueryString["PE"] != "") { PeriodDetail = new Microsoft.Reporting.WebForms.ReportParameter("PeriodDetail", Convert.ToString(Request.QueryString["PE"])); } else { PeriodDetail = new Microsoft.Reporting.WebForms.ReportParameter("PeriodDetail", "-1"); } if (Convert.ToString(Request.QueryString["Sts"]) != "") { Status = new Microsoft.Reporting.WebForms.ReportParameter("Status", Convert.ToString(Request.QueryString["Sts"])); } else { Status = new Microsoft.Reporting.WebForms.ReportParameter("Status", "-1"); } Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Session["ORG_ID"])); SubDepartment = new Microsoft.Reporting.WebForms.ReportParameter("SubDepartment", "-1"); //Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, Period, BusinessUnit, Department }; Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, BusinessUnit, Directorate, Department, SubDepartment, Period, PeriodDetail, Status }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_Nhif.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Nhif_report", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { RPT_AppraisalDoneReport.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_AppraisalDoneReport.ServerReport; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter BusinessUnit; Microsoft.Reporting.WebForms.ReportParameter AppraisalCycle; Microsoft.Reporting.WebForms.ReportParameter RptMgr; string sDomain = ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; serverReport.ReportPath = MyReportPath + "Appraisal Done"; if (Convert.ToString(Request.QueryString["ORG_ID"]) != "") { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Request.QueryString["ORG_ID"])); } else { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", "-1"); } if (Convert.ToString(Request.QueryString["BU"]) != "") { BusinessUnit = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", Convert.ToString(Request.QueryString["BU"])); } else { BusinessUnit = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", "-1"); } if (Convert.ToString(Request.QueryString["AppCycle"]) != "") { AppraisalCycle = new Microsoft.Reporting.WebForms.ReportParameter("AppraisalCycle", Convert.ToString(Request.QueryString["AppCycle"])); } else { AppraisalCycle = new Microsoft.Reporting.WebForms.ReportParameter("AppraisalCycle", "-1"); } if (Convert.ToString(Request.QueryString["RptMgr"]) != "") { RptMgr = new Microsoft.Reporting.WebForms.ReportParameter("RptMgr", Convert.ToString(Request.QueryString["RptMgr"])); } else { RptMgr = new Microsoft.Reporting.WebForms.ReportParameter("RptMgr", "-1"); } Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, BusinessUnit, AppraisalCycle, RptMgr }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_AppraisalDoneReport.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Pms_AppraisalDoneReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
public ActionResult ShowReport(FormCollection form) { var model = Session.Get <ReportParametersModel>(Strings.CachedMODELParameters); if (model == null) { return(RedirectToAction("Index", "Administration")); } var currenReportId = Session[Strings.REPORTID].Cast <Guid>(); var ctx2 = PTFReportsContext.Current; var report = ctx2.Reports.First(r => r.ReportID == currenReportId); var param = report.Parameters.FirstOrDefault(p => p.ParamType == (int)ParamMapping.IsoID); model.CountryParamID = (param != null) ? param.Name : null; param = report.Parameters.FirstOrDefault(p => p.ParamType == (int)ParamMapping.CompanyID); model.CompanyParamID = (param != null) ? param.Name : null; param = report.Parameters.FirstOrDefault(p => p.ParamType == (int)ParamMapping.RetailerID); model.RetailerParamID = (param != null) ? param.Name : null; param = report.Parameters.FirstOrDefault(p => p.ParamType == (int)ParamMapping.Language); model.LanguageParam = (param != null) ? param.Name : null; if (model.CountryParamID.IsNullEmptyOrWhite() && model.CompanyParamID.IsNullEmptyOrWhite() && model.RetailerParamID.IsNullEmptyOrWhite()) { return(Redirect("ViewReport.aspx")); } var retailerIds = Request.Form["RetailerID"]; model.RetailerID = retailerIds.Split <int, Guid>(',', (s) => int.Parse(s), (s) => Guid.Parse(s), (g) => { int iso_id, ho_id, br_id, fake; CommonTools.FromGuid(g, out iso_id, out ho_id, out br_id, out fake); return(br_id); }); var names = new string[] { model.CountryParamID, model.CompanyParamID, model.LanguageParam }; var values = new int[] { model.CountryID, model.CompanyID, model.LanguageID }; ReportData table = new ReportData(); table.ReportPath = model.Page; table.ReportName = model.Name; string url = string.Format("{0};{1};{2};{3};{4};{5};{6};{7}", table.ReportPath, model.CountryParamID, model.CountryID, model.CompanyParamID, model.CompanyID, model.RetailerParamID, model.LanguageParam, retailerIds); var session = PTFReportsDB.Session.GetByID(Session.SessionID); ctx2.AddToHistories(new History() { Session = session, Page = url, Date = DateTime.Now, }); ctx2.SaveChanges(); ms.ReportParameter rparam = null; //CountryID, HeadOfficeID for (int i = 0; i < names.Length; i++) { if (!string.IsNullOrWhiteSpace(names[i])) { rparam = new ms.ReportParameter(); rparam.Name = names[i]; rparam.Values.Add(Convert.ToString(values[i])); rparam.Visible = false; table.List.Add(rparam); } } //RetailerID if (!model.RetailerParamID.IsNullEmptyOrWhite()) { rparam = new ms.ReportParameter(); rparam.Name = model.RetailerParamID; foreach (int id in model.RetailerID) { rparam.Values.Add(id.ToString()); } rparam.Visible = false; table.List.Add(rparam); } Session[Strings.ReportParameterList] = table; return(Redirect("ViewReport.aspx")); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { RPT_P9Report1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_P9Report1.ServerReport; Microsoft.Reporting.WebForms.ReportParameter BusinessGroup; Microsoft.Reporting.WebForms.ReportParameter Period; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter Employee; string sDomain = System.Configuration.ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient Wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; serverReport.ReportPath = MyReportPath + "P9"; //if (Convert.ToString(Request.QueryString["DEPT"]) != null) //{ // Department = new Microsoft.Reporting.WebForms.ReportParameter("Department", Convert.ToString(Request.QueryString["DEPT"])); //} //else //{ // Department = new Microsoft.Reporting.WebForms.ReportParameter("Department", "-1"); //} if (Convert.ToString(Request.QueryString["BU"]) != "") { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", Convert.ToString(Request.QueryString["BU"])); } else { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", "-1"); } if (Convert.ToString(Request.QueryString["PRD"]) != "") { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", Convert.ToString(Request.QueryString["PRD"])); } else { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", "-1"); } if (Convert.ToString(Request.QueryString["EMP"]) != "") { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", Convert.ToString(Request.QueryString["EMP"])); } else { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", "-1"); } Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Session["ORG_ID"])); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, Period, BusinessGroup, Employee }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_P9Report1.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "P9Report", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { RPT_Years.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_Years.ServerReport; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter BusinessGroup; //Microsoft.Reporting.WebForms.ReportParameter Department; Microsoft.Reporting.WebForms.ReportParameter Employee; Microsoft.Reporting.WebForms.ReportParameter Status; string sDomain = ConfigurationSettings.AppSettings["MyReportViewerDomain"]; string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; WebClient wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); serverReport.ReportPath = MyReportPath + "RptYearsInService"; if (Convert.ToString(Request.QueryString["BU"]) != "") { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", Convert.ToString(Request.QueryString["BU"])); } else { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", "-1"); } if (Convert.ToString(Request.QueryString["EMP"]) != "") { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", Convert.ToString(Request.QueryString["EMP"])); } else { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", "-1"); } if (Convert.ToString(Request.QueryString["ORG"]) != "") { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Request.QueryString["ORG"])); } else { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", "-1"); } if (Convert.ToString(Request.QueryString["sts"]) != "") { Status = new Microsoft.Reporting.WebForms.ReportParameter("Status", Convert.ToString(Request.QueryString["sts"])); } else { Status = new Microsoft.Reporting.WebForms.ReportParameter("Status", "-1"); } //Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Session["ORG_ID"])); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, BusinessGroup, Employee, Status }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_Years.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "YearsofserviceReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { RPT_CmprsnRptWithPrevMnth.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_CmprsnRptWithPrevMnth.ServerReport; Microsoft.Reporting.WebForms.ReportParameter Period; Microsoft.Reporting.WebForms.ReportParameter PeriodElement; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter BusinessUnit; Microsoft.Reporting.WebForms.ReportParameter Status; string sDomain = ConfigurationSettings.AppSettings["MyReportViewerDomain"]; string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; WebClient wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string Report_Name = string.Empty; Report_Name = "RptWithreportWithPreviousMonth"; serverReport.ReportPath = MyReportPath + Report_Name; if (Convert.ToString(Request.QueryString["PRD"]) != "") { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", Convert.ToString(Request.QueryString["PRD"])); } else { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", "-1"); } if (Convert.ToString(Request.QueryString["PRDDTL"]) != "") { PeriodElement = new Microsoft.Reporting.WebForms.ReportParameter("PeriodElement", Convert.ToString(Request.QueryString["PRDDTL"])); } else { PeriodElement = new Microsoft.Reporting.WebForms.ReportParameter("PeriodElement", "-1"); } if (Convert.ToString(Request.QueryString["ORG"]) != "") { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Request.QueryString["ORG"])); } else { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", "-1"); } if (Convert.ToString(Request.QueryString["BU"]) != "") { BusinessUnit = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", Convert.ToString(Request.QueryString["BU"])); } else { BusinessUnit = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", "-1"); } if (Convert.ToString(Request.QueryString["sts"]) != "") { Status = new Microsoft.Reporting.WebForms.ReportParameter("Status", Convert.ToString(Request.QueryString["sts"])); } else { Status = new Microsoft.Reporting.WebForms.ReportParameter("Status", "-1"); } Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, BusinessUnit, Period, PeriodElement, Status }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_CmprsnRptWithPrevMnth.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "CmprsnRptWithPrevMnthReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Submit_Click(object sender, EventArgs e) { try { RPT_ExpenseReport.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_ExpenseReport.ServerReport; string sDomain = System.Configuration.ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient Wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); serverReport.ReportPath = "/SmartHR/" + "Employee Expense Report"; Microsoft.Reporting.WebForms.ReportParameter BusinessGroup; Microsoft.Reporting.WebForms.ReportParameter Employee; Microsoft.Reporting.WebForms.ReportParameter StartDate; Microsoft.Reporting.WebForms.ReportParameter EndDate; Microsoft.Reporting.WebForms.ReportParameter Includedates; Microsoft.Reporting.WebForms.ReportParameter Organisation; Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Session["ORG_ID"])); if (ddl_BusinessUnit.SelectedIndex != 0) { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", ddl_BusinessUnit.SelectedValue); } else { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", "-1"); } if (ddl_Employee.SelectedIndex != 0) { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", Convert.ToString(ddl_Employee.SelectedValue)); } else { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", "-1"); } if ((txt_StartDate.SelectedDate != null) && (txt_EndDate.SelectedDate != null)) { Includedates = new Microsoft.Reporting.WebForms.ReportParameter("Includedates", "YES"); StartDate = new Microsoft.Reporting.WebForms.ReportParameter("StartDate", txt_StartDate.SelectedDate.Value.ToShortDateString()); EndDate = new Microsoft.Reporting.WebForms.ReportParameter("EndDate", txt_EndDate.SelectedDate.Value.ToShortDateString()); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { BusinessGroup, Employee, Includedates, StartDate, EndDate }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_ExpenseReport.Visible = true; } if ((txt_StartDate.SelectedDate != null) && (txt_EndDate.SelectedDate == null)) { Includedates = new Microsoft.Reporting.WebForms.ReportParameter("Includedates", "YES"); StartDate = new Microsoft.Reporting.WebForms.ReportParameter("StartDate", txt_StartDate.SelectedDate.Value.ToShortDateString()); EndDate = new Microsoft.Reporting.WebForms.ReportParameter("EndDate", DateTime.Now.ToShortDateString()); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { BusinessGroup, Employee, Includedates, StartDate, EndDate }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_ExpenseReport.Visible = true; } else { Includedates = new Microsoft.Reporting.WebForms.ReportParameter("INCLUDEDATES", "NO"); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { BusinessGroup, Employee, Includedates }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_ExpenseReport.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Expense_Report", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void RetrieveFieldsDetailLocal() { string mlTANGGAL = ""; string mlRECEIVEDCODE = ""; string mlRECEIVEDBY = ""; mlDATATABLE = (DataTable)Session["FormEditReceiptData"]; mlTANGGAL = FormatDateyyyyMMdd(Convert.ToDateTime(mlDATATABLE.Rows[0]["InvPreparedForDate"])); mlRECEIVEDCODE = mlDATATABLE.Rows[0]["InvCodeMess"].ToString(); mlRECEIVEDBY = mlDATATABLE.Rows[0]["InvMessName"].ToString(); if (mlDATATABLE.Rows[0]["InvStatus"].ToString() == "PROCEEDS" && mlDATATABLE.Rows[0]["InvReceiptFlag"].ToString() == "R") { mlSQL2 = "SELECT * FROM INV_DELIVERY " + "WHERE Disabled = 0 AND InvReceiptFlag = 'R' AND InvReceiptCode = '" + mlDATATABLE.Rows[0]["InvReceiptCode"].ToString() + "'" + " AND InvPreparedForDate = '" + mlTANGGAL + "' AND InvCodeMess = '" + mlRECEIVEDCODE + "' AND InvMessName = '" + mlRECEIVEDBY + "' " + "ORDER BY InvPreparedForDate Desc"; mlREADER2 = mlOBJGS.DbRecordset(mlSQL2, "PB", mlCOMPANYID); mlDATATABLE1 = InsertReaderToDatatable(mlDATATABLE1, mlDATAROW, mlREADER2); } ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/pj_delinv/InvReceiptH.rdlc"); Microsoft.Reporting.WebForms.ReportParameter mlRECEIPTCODE = new Microsoft.Reporting.WebForms.ReportParameter("ReceiptCode", mlDATATABLE.Rows[0]["InvReceiptCode"].ToString()); Microsoft.Reporting.WebForms.ReportParameter mlCODEMESS = new Microsoft.Reporting.WebForms.ReportParameter("CodeMess", mlDATATABLE.Rows[0]["InvCodeMess"].ToString()); Microsoft.Reporting.WebForms.ReportParameter mlCOMPNAME = new Microsoft.Reporting.WebForms.ReportParameter("CompanyName", mlCOMPANYNAME); Microsoft.Reporting.WebForms.ReportParameter mlCOMPADDR = new Microsoft.Reporting.WebForms.ReportParameter("CompanyAddress", mlCOMPANYADDRESS); Microsoft.Reporting.WebForms.ReportParameter mlTITLE = new Microsoft.Reporting.WebForms.ReportParameter("Title", "INVOICE / RECEIPT"); //Microsoft.Reporting.WebForms.ReportDataSource mlDATASOURCE = new Microsoft.Reporting.WebForms.ReportDataSource("INV_RECEIPT_DATAH", mlDATATABLE); Microsoft.Reporting.WebForms.ReportDataSource mlDATASOURCE = new Microsoft.Reporting.WebForms.ReportDataSource(); Microsoft.Reporting.WebForms.LocalReport mlREPORTH = new Microsoft.Reporting.WebForms.LocalReport(); mlDATASOURCE.Name = "INV_RECEIPT_DATAH"; mlDATASOURCE.Value = mlDATATABLE; mlREPORTH.ReportEmbeddedResource = "~/pj_delinv/InvReceiptH.rdlc"; mlREPORTH.DataSources.Add(mlDATASOURCE); ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SetSubDataSource); ReportViewer1.LocalReport.ReportEmbeddedResource = mlREPORTH.ReportEmbeddedResource; ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(mlDATASOURCE); ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { mlRECEIPTCODE, mlCODEMESS, mlCOMPNAME, mlCOMPADDR, mlTITLE }); ReportViewer1.LocalReport.Refresh(); }
protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/" + reportName); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); LSDAL dal = new LSDAL(); TJDAL dalt = new TJDAL(); switch (reportName) { case "LS_ZDTFXZHSG.rdlc"://重大突发性灾害事故流水表 this.Page.Title = "重大突发性灾害事故流水表"; DataTable dt = dal.Get_LS_ZDTFXZHSG(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_ZDTFXZHSG", dt)); break; case "LS_DDRZ.rdlc"://调度日志流水表 this.Page.Title = "调度日志流水表"; DataTable dt1 = dal.Get_LS_DDRZ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_DDRZ", dt1)); break; case "LS_FSTZ.rdlc"://发送通知流水表 this.Page.Title = "发送通知流水表"; DataTable dt2 = dal.Get_LS_FSTZ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_FSTZ", dt2)); break; case "LS_RCJJDDLFDSJD.rdlc"://日常急救到达率分段(时间段)表 this.Page.Title = "日常急救到达率分段(时间段)表"; DataTable dt3 = dal.Get_LS_RCJJDDLFDSJD(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_RCJJDDLFDSJD", dt3)); DataTable dte = dal.Get_LS_RCJJDDLFDSJDSum(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_RCJJDDLFDSJDSum", dte)); break; case "LS_SJDWCGL.rdlc"://手机定位成功率统计表 this.Page.Title = "手机定位成功率统计表"; DataTable dt4 = dal.Get_LS_SJDWCGL(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_SJDWCGL", dt4)); break; case "LS_WZBRBQYBDJ.rdlc"://危重病人病情预报登记表 this.Page.Title = "危重病人病情预报登记表"; DataTable dt5 = dal.Get_LS_WZBRBQYBDJ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_WZBRBQYBDJ", dt5)); break; case "LS_YYGZDJ.rdlc"://医院搁置担架统计表 this.Page.Title = "医院搁置担架统计表"; DataTable dt6 = dal.Get_LS_YYGZDJ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_YYGZDJ", dt6)); break; case "LS_YYGZJHCDJYXCC.rdlc"://医院搁置救护车担架影响出车统计表 this.Page.Title = "医院搁置救护车担架影响出车统计表"; DataTable dt7 = dal.Get_LS_YYGZJHCDJYXCC(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_YYGZJHCDJYXCC", dt7)); break; case "TJ_CCCSFD.rdlc"://出车次数分段统计表 this.Page.Title = "出车次数分段统计表"; DataTable dt8 = dalt.Get_TJ_CCCSFD(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_CCCSFD", dt8)); break; case "TJ_CCQK.rdlc"://出车情况统计表 this.Page.Title = "出车情况统计表"; DataTable dt9 = dalt.Get_TJ_CCQK(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_CCQK", dt9)); break; case "TJ_DDYGZL.rdlc"://调度员工作量统计表 this.Page.Title = "调度员工作量统计表"; DataTable dt10 = dalt.Get_TJ_DDYGZL(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_DDYGZL", dt10)); break; case "TJ_DDYGZL2.rdlc"://调度员工作量统计表(二) this.Page.Title = "调度员工作量统计表(二)"; DataTable dt11 = dalt.Get_TJ_DDYGZL2(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_DDYGZL2", dt11)); break; case "TJ_DDYGZXL.rdlc"://调度员工作效率统计表 this.Page.Title = "调度员工作效率统计表"; DataTable dt12 = dalt.Get_TJ_DDYGZXL(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_DDYGZXL", dt12)); break; case "TJ_DJJ.rdlc"://对讲机统计表 this.Page.Title = "对讲机统计表"; DataTable dt13 = dalt.Get_TJ_DJJ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_DJJ", dt13)); break; case "TJ_FCQKMX2.rdlc"://放车情况明细统计表(二) this.Page.Title = "放车情况明细统计表(二)"; DataTable dt14 = dalt.Get_TJ_FCQKMX2(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FCQKMX2", dt14)); break; case "TJ_FCQKMX1.rdlc"://放车情况明细统计表(一) this.Page.Title = "放车情况明细统计表(一)"; DataTable dt15 = dalt.Get_TJ_FCQKMX1(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FCQKMX1", dt15)); DataTable dt16 = dalt.Get_TJ_FCQKMX1BT1(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FCQKMX1_BING1", dt16)); DataTable dt17 = dalt.Get_TJ_FCQKMX1BT2(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FCQKMX1_BING2", dt17)); DataTable dt18 = dalt.Get_TJ_FCQKMX1ZX(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FCQKMX1_ZHEXIAN1", dt18)); break; case "TJ_FCYQYSJGX.rdlc"://放车与区域时间关系统计表 this.Page.Title = "放车与区域时间关系统计表"; DataTable dt19 = dalt.Get_TJ_FCYQYSJGX(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FCYQYSJGX", dt19)); break; case "TJ_FZXBGFSXB.rdlc"://分中心上下班问题统计表 this.Page.Title = "分中心上下班问题统计表"; DataTable dt20 = dalt.Get_TJ_FZXSXBWT(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FZXBGFSXB", dt20)); break; case "TJ_FZXZTDY.rdlc"://分中心暂停调用统计表 this.Page.Title = "分中心暂停调用统计表"; DataTable dt21 = dalt.Get_TJ_FZXZTDY(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FZXZTDY", dt21)); break; case "TJ_HJBZQK.rdlc"://呼病种情况统计表 this.Page.Title = "呼病种情况统计表"; DataTable dt22 = dalt.Get_TJ_HJBZQK(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_HJBZQK", dt22)); DataTable dt23 = dalt.Get_TJ_HJBZQK_XBYJB(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_HJBZQK_XBYJB", dt23)); DataTable dt24 = dalt.Get_TJ_HJBZQK_NLYJB(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_HJBZQK_NLYJB", dt24)); break; case "TJ_HJDHPDFZ.rdlc"://呼救电话排队峰值统计表 this.Page.Title = "呼救电话排队峰值统计表"; DataTable dt25 = dalt.Get_TJ_HJDHPDFZ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetFor_TJ_HJDHPDFZ", dt25)); break; case "TJ_HCYQYSJGX.rdlc"://回车与区域时间关系统计表 this.Page.Title = "回车与区域时间关系统计表"; DataTable dt26 = dalt.Get_TJ_HCYQYSJGX(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_HCYQYSJGX", dt26)); break; case "TJ_JJFYSJRB.rdlc"://急救反应时间(日报)统计表 this.Page.Title = "急救反应时间(日报)统计表"; DataTable dt27 = dalt.Get_TJ_JJFYSJRB(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JJFYSJRB", dt27)); DataTable dt28 = dalt.Get_TJ_JJFYSJRB1(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JJFYSJRB1", dt28)); DataTable dt29 = dalt.Get_TJ_JJFYSJRB2(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JJFYSJRB2", dt29)); DataTable dt30 = dalt.Get_TJ_JJFYSJRB_CenterTime(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JJFYSJRB_CenterTime", dt30)); break; case "TJ_JBYSJGX.rdlc"://疾病与时间关系统计表 this.Page.Title = "疾病与时间关系统计表"; DataTable dt32 = dalt.Get_TJ_JBYSJGX(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JBYSJGX", dt32)); break; case "TJ_RJRCCCSFB.rdlc"://人均日出车次数分布统计表 this.Page.Title = "人均日出车次数分布统计表"; DataTable dt33 = dalt.Get_TJ_RJRCCCSFB(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_RJRCCCSFB", dt33)); break; case "TJ_SWDDLX.rdlc"://送往地点类型统计表 this.Page.Title = "送往地点类型统计表"; DataTable dt34 = dalt.Get_TJ_SWDDLX(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_SWDDLX", dt34)); break; case "TJ_SWDD.rdlc"://送往地点统计表 this.Page.Title = "送往地点统计表"; DataTable dt35 = dalt.Get_TJ_SWDD(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_SWDD", dt35)); break; case "TJ_WZBRBQYBDJ.rdlc"://危重病人病情预报登记统计表 this.Page.Title = "危重病人病情预报登记统计表"; DataTable dt36 = dalt.Get_TJ_WZBRBQYBDJ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_WZBRBQYBDJ", dt36)); break; case "TJ_WJSFCSJFX.rdlc"://未及时放车时间分析表 this.Page.Title = "未及时放车时间分析表"; DataTable dt37 = dalt.Get_TJ_WJSFCSJFX(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_WJSFCSJFX", dt37)); break; case "TJ_XCDD.rdlc"://现场地点统计表 this.Page.Title = "现场地点统计表"; DataTable dt38 = dalt.Get_TJ_XCDD(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_XCDD", dt38)); break; case "TJ_ZFZXCS.rdlc"://转分中心次数统计表 this.Page.Title = "转分中心次数统计表"; DataTable dt39 = dalt.Get_TJ_ZFZXCS(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_ZFZXCS", dt39)); break; case "TJ_ZYSJ.rdlc"://转院数据统计表 this.Page.Title = "转院数据统计表"; DataTable dt40 = dalt.Get_TJ_ZYSJ(start, end); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_ZYSJ", dt40)); break; default: break; } this.ReportViewer1.LocalReport.Refresh(); }
private void RetrieveFieldsDetailPDF1() { string mlTANGGAL = ""; string mlRECEIVEDCODE = ""; string mlRECEIVEDBY = ""; Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; string filename = ""; string deviceInfo = "<DeviceInfo>" + " <OutputFormat>EMF</OutputFormat>" + " <PageWidth>8.27in</PageWidth>" + " <PageHeight>11.69in</PageHeight>" + " <MarginTop>0.7874in</MarginTop>" + " <MarginLeft>0.98425in</MarginLeft>" + " <MarginRight>0.98425in</MarginRight>" + " <MarginBottom>0.7874in</MarginBottom>" + "</DeviceInfo>"; mlDATATABLE = (DataTable)Session["FormEditReceiptData"]; mlTANGGAL = FormatDateyyyyMMdd(Convert.ToDateTime(mlDATATABLE.Rows[0]["InvPreparedForDate"])); mlRECEIVEDCODE = mlDATATABLE.Rows[0]["InvCodeMess"].ToString(); mlRECEIVEDBY = mlDATATABLE.Rows[0]["InvMessName"].ToString(); if (mlDATATABLE.Rows[0]["InvStatus"].ToString() == "PROCEEDS" && mlDATATABLE.Rows[0]["InvReceiptFlag"].ToString() == "R") { mlSQL2 = "SELECT * FROM INV_DELIVERY " + "WHERE Disabled = '0' AND InvReceiptFlag = 'R' AND InvReceiptCode = '" + mlDATATABLE.Rows[0]["InvReceiptCode"].ToString() + "'" + " AND InvPreparedForDate = '" + mlTANGGAL + "' AND InvCodeMess = '" + mlRECEIVEDCODE + "' AND InvMessName = '" + mlRECEIVEDBY + "' " + "ORDER BY InvPreparedForDate Desc"; mlREADER2 = mlOBJGS.DbRecordset(mlSQL2, "PB", mlCOMPANYID); mlDATATABLE1 = InsertReaderToDatatable(mlDATATABLE1, mlDATAROW, mlREADER2); } //else //{ // mlDATATABLE1 = mlDATATABLE.Copy(); //} ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/pj_delinv/InvReceiptH.rdlc"); Microsoft.Reporting.WebForms.ReportParameter mlRECEIPTCODE = new Microsoft.Reporting.WebForms.ReportParameter("ReceiptCode", mlDATATABLE.Rows[0]["InvReceiptCode"].ToString()); Microsoft.Reporting.WebForms.ReportParameter mlCODEMESS = new Microsoft.Reporting.WebForms.ReportParameter("CodeMess", mlDATATABLE.Rows[0]["InvCodeMess"].ToString()); Microsoft.Reporting.WebForms.ReportParameter mlCOMPNAME = new Microsoft.Reporting.WebForms.ReportParameter("CompanyName", mlCOMPANYNAME); Microsoft.Reporting.WebForms.ReportParameter mlCOMPADDR = new Microsoft.Reporting.WebForms.ReportParameter("CompanyAddress", mlCOMPANYADDRESS); Microsoft.Reporting.WebForms.ReportParameter mlTITLE = new Microsoft.Reporting.WebForms.ReportParameter("Title", "INVOICE / RECEIPT"); Microsoft.Reporting.WebForms.ReportDataSource mlDATASOURCE = new Microsoft.Reporting.WebForms.ReportDataSource(); Microsoft.Reporting.WebForms.LocalReport mlREPORTH = new Microsoft.Reporting.WebForms.LocalReport(); mlDATASOURCE.Name = "INV_RECEIPT_DATAH"; mlDATASOURCE.Value = mlDATATABLE; mlREPORTH.ReportEmbeddedResource = "~/pj_delinv/InvReceiptH.rdlc"; mlREPORTH.DataSources.Add(mlDATASOURCE); ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SetSubDataSource); ReportViewer1.LocalReport.ReportEmbeddedResource = mlREPORTH.ReportEmbeddedResource; ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(mlDATASOURCE); ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { mlRECEIPTCODE, mlCODEMESS, mlCOMPNAME, mlCOMPADDR, mlTITLE }); //byte[] bytes = ReportViewer1.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); byte[] bytes = ReportViewer1.LocalReport.Render("PDF", deviceInfo, out mimeType, out encoding, out extension, out streamIds, out warnings); string path = Server.MapPath("~/pj_delinv/Print_Files"); // Open PDF File in Web Browser filename = "InvReceipt"; extension = "pdf"; FileStream file = new FileStream(path + "/" + filename + "." + extension, FileMode.OpenOrCreate, FileAccess.ReadWrite); file.Write(bytes, 0, bytes.Length); file.Dispose(); WebClient client = new WebClient(); Byte[] buffer = client.DownloadData(path + "/" + filename + "." + extension); if (buffer != null) { Response.ContentType = "application/pdf"; Response.AddHeader("content-length", buffer.Length.ToString()); Response.BinaryWrite(buffer); } }
private void RetrieveFieldsDetailPDF() { string mlTANGGAL = ""; string mlRECEIVEDCODE = ""; string mlRECEIVEDBY = ""; Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; string filename = ""; mlDATATABLE = (DataTable)Session["FormEditReceiptData"]; mlTANGGAL = FormatDateyyyyMMdd(Convert.ToDateTime(mlDATATABLE.Rows[0]["InvPreparedForDate"])); mlRECEIVEDCODE = mlDATATABLE.Rows[0]["InvCodeMess"].ToString(); mlRECEIVEDBY = mlDATATABLE.Rows[0]["InvMessName"].ToString(); if (mlDATATABLE.Rows[0]["InvStatus"].ToString() == "PROCEEDS" && mlDATATABLE.Rows[0]["InvReceiptFlag"].ToString() == "R") { mlSQL2 = "SELECT * FROM INV_DELIVERY " + "WHERE Disabled = 0 AND InvReceiptFlag = 'R' AND InvPreparedForDate = '" + mlTANGGAL + "' AND InvCodeMess = '" + mlRECEIVEDCODE + "' AND InvMessName = '" + mlRECEIVEDBY + "' " + "ORDER BY InvPreparedForDate Desc"; mlREADER2 = mlOBJGS.DbRecordset(mlSQL2, "PB", mlCOMPANYID); mlDATATABLE1 = InsertReaderToDatatable(mlDATATABLE1, mlDATAROW, mlREADER2); } ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/pj_delinv/InvReceiptH.rdlc"); Microsoft.Reporting.WebForms.ReportParameter mlRECEIPTCODE = new Microsoft.Reporting.WebForms.ReportParameter("ReceiptCode", mlDATATABLE.Rows[0]["InvReceiptCode"].ToString()); Microsoft.Reporting.WebForms.ReportParameter mlCODEMESS = new Microsoft.Reporting.WebForms.ReportParameter("CodeMess", mlDATATABLE.Rows[0]["InvCodeMess"].ToString()); Microsoft.Reporting.WebForms.ReportParameter mlCOMPNAME = new Microsoft.Reporting.WebForms.ReportParameter("CompanyName", mlCOMPANYNAME); Microsoft.Reporting.WebForms.ReportParameter mlCOMPADDR = new Microsoft.Reporting.WebForms.ReportParameter("CompanyAddress", mlCOMPANYADDRESS); Microsoft.Reporting.WebForms.ReportParameter mlTITLE = new Microsoft.Reporting.WebForms.ReportParameter("Title", "INVOICE / RECEIPT"); Microsoft.Reporting.WebForms.ReportDataSource mlDATASOURCE = new Microsoft.Reporting.WebForms.ReportDataSource(); Microsoft.Reporting.WebForms.LocalReport mlREPORTH = new Microsoft.Reporting.WebForms.LocalReport(); mlDATASOURCE.Name = "INV_RECEIPT_DATAH"; mlDATASOURCE.Value = mlDATATABLE; mlREPORTH.ReportEmbeddedResource = "~/pj_delinv/InvReceiptH.rdlc"; mlREPORTH.DataSources.Add(mlDATASOURCE); ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SetSubDataSource); ReportViewer1.LocalReport.ReportEmbeddedResource = mlREPORTH.ReportEmbeddedResource; ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(mlDATASOURCE); ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { mlRECEIPTCODE, mlCODEMESS, mlCOMPNAME, mlCOMPADDR, mlTITLE }); byte[] bytes = ReportViewer1.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); filename = "InvReceipt"; extension = "pdf"; // Now that you have all the bytes representing the PDF report, buffer it and send it to the client. Response.Buffer = true; Response.Clear(); Response.ContentType = mimeType; Response.AddHeader("content-disposition", "attachment; filename=" + filename + "." + extension); Response.BinaryWrite(bytes); // create the file Response.Flush(); // send it to the client to download Response.End(); //Body.Size.Width + Report.Margins.Left + Report.Margins.Right <= Report.PageSize.Width }