private void GetData() { string strWhere = "1=1"; string pointId = Request["pointId"]; //拼写条件语句(注:条件中的列名要与点位上的列名一致) if (pointId != "") { strWhere += " and ID='" + pointId + "'"; } //填报表需要显示信息(注:这Table里面的第一列数据要与填报表的列名一致) DataTable dtShow = new DataTable(); dtShow = new TEnvFillNoiseFunctionLogic().CreateShowDT(); CommonLogic com = new CommonLogic(); DataTable dt = com.GetFillData(strWhere, dtShow, TEnvFillNoiseFunctionSummaryVo.T_ENV_FILL_NOISE_FUNCTION_SUMMARY_TABLE, TEnvPNoiseFunctionVo.T_ENV_P_NOISE_FUNCTION_TABLE, TEnvPNoiseFunctionItemVo.T_ENV_P_NOISE_FUNCTION_ITEM_TABLE, TEnvFillNoiseFunctionVo.T_ENV_FILL_NOISE_FUNCTION_TABLE, TEnvFillNoiseFunctionItemVo.T_ENV_FILL_NOISE_FUNCTION_ITEM_TABLE, SerialType.T_ENV_FILL_NOISE_FUNCTION, SerialType.T_ENV_FILL_NOISE_FUNCTION_ITEM, SerialType.T_ENV_FILL_NOISE_FUNCTION_SUMMARY); string json = DataTableToJsonUnsureCol(dt); Response.ContentType = "application/json"; Response.Write(json); Response.End(); }
//21,交通噪声汇总表 //22,区域噪声汇总表 //23,功能区噪声汇总表 private void PrintLocal_EnvNoise(string strYear, string strMonth, string strPointID, string strSheetType) { DataTable dtSrcFill = new DataTable(); DataTable dtSrcResult = new DataTable(); if (strSheetType == "21") { dtSrcFill = new TEnvFillNoiseRoadLogic().SelectFill_ForSummary(strYear, strMonth, strPointID); dtSrcResult = new TEnvFillNoiseRoadLogic().SelectResult_ForSummary(strYear, strMonth, strPointID); } else if (strSheetType == "22") { dtSrcFill = new TEnvFillNoiseAreaLogic().SelectFill_ForSummary(strYear, strMonth, strPointID); dtSrcResult = new TEnvFillNoiseAreaLogic().SelectResult_ForSummary(strYear, strMonth, strPointID); } else if (strSheetType == "23") { dtSrcFill = new TEnvFillNoiseFunctionLogic().SelectFill_ForSummary(strYear, strMonth, strPointID); dtSrcResult = new TEnvFillNoiseFunctionLogic().SelectResult_ForSummary(strYear, strMonth, strPointID); } //标题数组 ArrayList arrTitle = getPrintLocalTitle_EnvNoise(strYear, strMonth, strSheetType); //结尾数组 ArrayList arrEnd = new ArrayList(); DataTable dtNew = new DataTable(); getPrintLocalColumn_EnvNoise(strSheetType, ref dtNew); getPrintLocalData_EnvNoise(dtSrcFill, dtSrcResult, strSheetType, ref dtNew); //项目列名数组 ArrayList arrData = getPrintLocalData(dtNew); new ExcelHelper().RenderDataTableToExcel(dtNew, "监测数据汇总表.xls", "../../../../TempFile/DataTotal-EnvNoise.xls", "监测数据汇总表", 3, true, arrTitle, arrData, arrEnd); }