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
///
/// 国标一
///
///
public List InsertReportTemplateTable_ChineseStandardABCDDS(OTSCLRINTERFACE.CPropParamClr cPropParamClr, List 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 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 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 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 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 GB1NameList = new List();
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 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 GB2NameList = new List();
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();
}
}
}