/// <summary> /// 设置数据表样式 /// </summary> /// <param name="report"></param> /// <returns></returns> private static DataTable SetReportStyle(BaseReport report, ReportStyle reportStyle) { if (OnReportProcessing != null) { ReportProcessingEventArgs e = new ReportProcessingEventArgs( ); e.Status = "数据排列中。。。"; OnReportProcessing(e); } DataTable tbResult = new DataTable( ); if (reportStyle == ReportStyle.科目为标题列) { tbResult = RebuildDataWithItemInColumn(report); } else { tbResult = RebuildDataWithItemInRow(report); } if (OnReportProcessing != null) { ReportProcessingEventArgs e = new ReportProcessingEventArgs( ); e.Status = "完成"; OnReportProcessing(e); } return(tbResult); }
/// <summary> /// 填充报表 /// </summary> /// <param name="Report"></param> public static void FillReport(BaseReport Report, DateTime?Btime, DateTime?Etime) { try { if (OnReportProcessing != null) { ReportProcessingEventArgs e = new ReportProcessingEventArgs(); e.Status = "数据查询中。。。"; OnReportProcessing(e); } HIS.DAL.MZ_DAL mzdal = new HIS.DAL.MZ_DAL(); mzdal._OleDB = oleDb; Report.BaseReportData = mzdal.GetChargeReport(Btime, Etime, Report.StatType); ConvertCodeToName(Report); Report.DataResult = SetReportStyle(Report, Report.Reportstyle); } catch (Exception err) { throw err; } }
/// <summary> /// 填充报表 /// </summary> /// <param name="Report"></param> public static void FillReport(BaseReport Report) { try { if (OnReportProcessing != null) { ReportProcessingEventArgs e = new ReportProcessingEventArgs( ); e.Status = "数据查询中。。。"; OnReportProcessing(e); } Report.BaseReportData = oleDb.GetDataTable(Report.DataSQL); if (Report is PatientFeeReport) { DataRow drTotal = Report.BaseReportData.NewRow( ); drTotal[0] = "合 计"; for (int i = 7; i < Report.BaseReportData.Columns.Count; i++) { string colName = Report.BaseReportData.Columns[i].ColumnName; object obj = Report.BaseReportData.Compute("Sum(" + colName + ")", ""); drTotal[colName] = obj.ToString(); } Report.BaseReportData.Rows.Add(drTotal); Report.DataResult = Report.BaseReportData; return; } ConvertCodeToName(Report); Report.DataResult = SetReportStyle(Report, Report.Reportstyle); } catch (Exception err) { throw err; } }