public void BindGrid() { int rowcount = ucCustomPagerItems.isCountRecord; string vesselcode = (ViewState["VesselCode"] == null) ? null : (ViewState["VesselCode"].ToString()); string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString()); } DataTable dt = BLL_Infra_Common.Get_Exception_Search(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue) , UDFLib.ConvertDateToNull(txtfrom.Text), UDFLib.ConvertDateToNull(txtto.Text), txtSearch.Text , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } if (dt.Rows.Count > 0) { gvDeckLogBook.DataSource = dt; gvDeckLogBook.DataBind(); } else { gvDeckLogBook.DataSource = dt; gvDeckLogBook.DataBind(); } }
protected void btnExport_Click(object sender, ImageClickEventArgs e) { int rowcount = ucCustomPagerItems.isCountRecord; string vesselcode = (ViewState["VesselCode"] == null) ? null : (ViewState["VesselCode"].ToString()); string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString()); } DataTable dt = BLL_Infra_Common.Get_Exception_Search(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue) , UDFLib.ConvertDateToNull(txtfrom.Text), UDFLib.ConvertDateToNull(txtto.Text), txtSearch.Text , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); //string[] HeaderCaptions = { "Vessel", "From Date", "To Date", "Remarks" }; //string[] DataColumnsName = { "Vessel_Name", "From_Date", "To_Date", "Remarks" }; //GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "DeckLogBook", "Deck Log Book", ""); }