123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- using System.Collections.Generic;
- using System.Data;
- using OTSIncAReportApp.ReportTemplate;
- using OTSIncAReportApp.OTSSampleReportInfo;
- using System.Collections;
- namespace OTSIncAReportApp.OTSTemplateDesigner
- {
- public class GBData
- {
- #region 全局变量
- public OTSReport_Export m_otsreport_export;
- #endregion
- #region 构造函数
- public GBData(OTSReport_Export in_export)
- {
- m_otsreport_export = in_export;
- }
-
- #endregion
- /// <summary>
- /// 国标一
- /// </summary>
- /// <returns></returns>
- public List<DataTable> InsertReportTemplateTable_ChineseStandardABCDDS(OTSCLRINTERFACE.CPropParamClr cPropParamClr, List<string> datasourcelist , int DataSourceId ,int GB_index)
- {
- //得到国标一的DataTable表格
- cPropParamClr.SetDataSourceList(datasourcelist);
- cPropParamClr.SetDataSourceId(DataSourceId);//
- cPropParamClr.SetType((int)OTSSampleReportInfo.DisplayPicutureType.AnalyzeDataTable);//table
- cPropParamClr.SetCalTableType(GB_index);//国标1
- if (GB_index == (int)OTSSampleReportInfo.CALCULATE_TABLE_TYPE.GB_Method1)
- {
- List<OTSCLRINTERFACE.CGridDataClr> listGriddataclr = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_ReportMgr.GridDataTransfer(cPropParamClr);
- m_otsreport_export.m_ReportApp.im_ChineseStandardABCDDS = new OTSIncAReportGB.ChineseStandardABCDDS(m_otsreport_export.m_ReportApp.m_rstDataMgr.m_ReportMgr, listGriddataclr);
- m_otsreport_export.m_ReportApp.m_TablesWindow.Controls.Clear();
- return m_otsreport_export.m_ReportApp.im_ChineseStandardABCDDS.ChineseStandardABCD_GetDataTable(); ;
- }
- else
- {
- List<OTSCLRINTERFACE.CGridDataClr> listGriddataclr2 = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_ReportMgr.GridDataTransfer(cPropParamClr);//
- m_otsreport_export.m_ReportApp.m_TablesWindow.Controls.Clear();
- m_otsreport_export.m_ReportApp.im_NationalStandardMethodTwo = new OTSIncAReportGB.NationalStandardMethodTwo(m_otsreport_export.m_ReportApp.m_rstDataMgr.m_ReportMgr, listGriddataclr2);
- return m_otsreport_export.m_ReportApp.im_NationalStandardMethodTwo.ChineseStandardABCD_GetDataTable();
- }
-
- }
- public void criterion_out(GBReport GB_Report, OTSReport_Export in_export,int Index, Hashtable table, bool gb_1,bool gb_2,bool AmericanStandard,bool GermanStandard)
- {
- //首页信息
-
- GB_Report = new GBReport(in_export, table);
-
- GB_Report.International_language();
- for (int i = 0; i < m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList.Count; i++)
- {
- string anothername = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName.ToString();
- string resultfile = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[i].FilePath.ToString() + "\\" + m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[i].FileName_real.ToString();
- m_otsreport_export.m_ReportApp.m_rstDataMgr.m_ReportMgr.AddASmplMsrResultMgr(resultfile, anothername);
- }
-
- List<string> datasourcelist = m_otsreport_export.m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
- OTSCLRINTERFACE.CPropParamClr clr_prop = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_ReportMgr.GetPropertyParamTable();
- clr_prop.SetDataSourceList(datasourcelist);
- clr_prop.SetDataSourceId(Index);//
- clr_prop.SetCalTableType((int)CALCULATE_TABLE_TYPE.GB_Method1);
- clr_prop.SetType((int)DisplayPicutureType.AnalyzeDataTable);//table
- var tbl = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_ReportMgr.GetAllGBFields(clr_prop);
- GB_Report.setResultGrid(m_otsreport_export.m_mbszclass, tbl);
- if (gb_1)
- {
- List<DataTable> GB1 = InsertReportTemplateTable_ChineseStandardABCDDS(clr_prop, datasourcelist, Index, (int)CALCULATE_TABLE_TYPE.GB_Method1);
- DataView dv_gb1 = GB1[4].DefaultView;
- dv_gb1.Sort = "Grade desc";
- DataTable dt_gb1 = dv_gb1.ToTable();
- for (int i=0; i < GB1[4].Rows.Count;i++)
- {
- for(int a=0;a< GB1[4].Columns.Count;a++)
- {
- GB1[4].Rows[i][a] = dt_gb1.Rows[i][a];
- }
-
- }
- List<string> GB1NameList = new List<string>();
- GB1NameList.Add("A类");
- GB1NameList.Add("B类");
- GB1NameList.Add("C类");
- GB1NameList.Add("D类");
- GB1NameList.Add("DS类");
- GB_Report.set_GB_Method(GB1, GB1NameList, "方法一");
- }
- if (gb_2)
- {
- List<DataTable> GB2 = InsertReportTemplateTable_ChineseStandardABCDDS(clr_prop, datasourcelist, Index, (int)CALCULATE_TABLE_TYPE.GB_Method2);
- DataView dv_gb1 = GB2[5].DefaultView;
- dv_gb1.Sort = "Grade desc";
- DataTable dt_gb1 = dv_gb1.ToTable();
- for (int i = 0; i < GB2[5].Rows.Count; i++)
- {
- for (int a = 0; a < GB2[5].Columns.Count; a++)
- {
- GB2[5].Rows[i][a] = dt_gb1.Rows[i][a];
- }
- }
- List<string> GB2NameList = new List<string>();
- GB2NameList.Add("A类");
- GB2NameList.Add("B类");
- GB2NameList.Add("C类");
- GB2NameList.Add("D类");
- GB2NameList.Add("D硫化物类");
- GB2NameList.Add("DS类");
- GB_Report.set_GB_Method(GB2, GB2NameList, "方法二");
- }
- DevExpress.XtraReports.UI.ReportPrintTool tool = new DevExpress.XtraReports.UI.ReportPrintTool(GB_Report);
- tool.ShowPreview();
- }
- }
- }
|