protected void btnView_Click(object sender, ImageClickEventArgs e) { string sFromDate = ""; string sToDate = ""; if (ViewState["sFromDT"].ToString() == "") { sFromDate = "1900/01/01"; } else { sFromDate = ViewState["sFromDT"].ToString(); } if (ViewState["sToDT"].ToString() == "") { sToDate = "1900/01/01"; } else { sToDate = ViewState["sToDT"].ToString(); } int Record_count = ucCustomPagerItems.isCountRecord; DataTable dtReport = BLL_ASM_OPS_VoyageReport.Get_DailyVoyageReportIndex(ViewState["sReportType"].ToString(), Convert.ToInt32(ViewState["iVesselID"]), Convert.ToInt32(ViewState["iLocationID"]), sFromDate, sToDate, Convert.ToInt32(ViewState["iFleetID"]), null, null, ref Record_count, UDFLib.ConvertStringToNull(ViewState["Sort_Column"]), UDFLib.ConvertStringToNull(ViewState["Sort_Direction"])); string[] HeaderCaptions = { "Vessel", "Report Date", "Report Type", "Voyage", "Location", "Next Port", "UTC HR", "Average Speed", "HSFO %S ROB", "LSFO %S ROB", "DO %S ROB" }; string[] DataColumnsName = { "VESSEL_NAME", "TELEGRAM_DATE", "TELEGRAM_TYPE_TEXT", "VOYAGE", "LOCATION_NAME", "NEXT_PORT", "UTC_HR", "AVERAGE_SPEED", "HO_ROB", "LSFO_ROB", "DO_ROB" }; GridViewExportUtil.ShowExcel(dtReport, HeaderCaptions, DataColumnsName, "VoyageReportList", "Voyage Report List", ""); }
protected void BindItems() { string sFromDate = ""; string sToDate = ""; if (ViewState["sFromDT"].ToString() == "") { sFromDate = "1900/01/01"; } else { sFromDate = ViewState["sFromDT"].ToString(); } if (ViewState["sToDT"].ToString() == "") { sToDate = "1900/01/01"; } else { sToDate = ViewState["sToDT"].ToString(); } int Record_count = 1; gvVoyageReport.DataSource = BLL_ASM_OPS_VoyageReport.Get_DailyVoyageReportIndex(ViewState["sReportType"].ToString(), Convert.ToInt32(ViewState["iVesselID"]), Convert.ToInt32(ViewState["iLocationID"]), sFromDate, sToDate, Convert.ToInt32(ViewState["iFleetID"]), UDFLib.ConvertIntegerToNull(ucCustomPagerItems.CurrentPageIndex), UDFLib.ConvertIntegerToNull(ucCustomPagerItems.PageSize), ref Record_count, UDFLib.ConvertStringToNull(ViewState["Sort_Column"]), UDFLib.ConvertStringToNull(ViewState["Sort_Direction"])); gvVoyageReport.DataBind(); ucCustomPagerItems.CountTotalRec = Record_count.ToString(); ucCustomPagerItems.BuildPager(); }