public void BindFbmReadSearch() { int rowcount = ucCustomPagerItems.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString()); } DataSet ds = BLL_QMSDB_Procedures.GetReadProcedureSearch(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue) , UDFLib.ConvertIntegerToNull(ddlFbmList.SelectedValue), txtSearchBy.Text.Trim() , UDFLib.ConvertIntegerToNull(ddlRank.SelectedValue), UDFLib.ConvertIntegerToNull(rdoFBMReadStatus.SelectedValue) , sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } if (ds.Tables[0].Rows.Count > 0) { gvFbmRead.DataSource = ds.Tables[0]; gvFbmRead.DataBind(); } else { gvFbmRead.DataSource = ds.Tables[0]; gvFbmRead.DataBind(); } }
protected void btnExport_Click(object sender, ImageClickEventArgs e) { int rowcount = ucCustomPagerItems.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString()); } DataSet ds = BLL_QMSDB_Procedures.GetReadProcedureSearch(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue) , UDFLib.ConvertIntegerToNull(ddlFbmList.SelectedValue), txtSearchBy.Text.Trim() , UDFLib.ConvertIntegerToNull(ddlRank.SelectedValue), UDFLib.ConvertIntegerToNull(rdoFBMReadStatus.SelectedValue) , sortbycoloumn, sortdirection, null, null, ref rowcount); string[] HeaderCaptions = { "Vessel", "Rank", "Staff Code", "Name", " Read On" }; string[] DataColumnsName = { "Vessel_Name", "Rank_Short_Name", "Staff_Code", "Staff_FullName", "FBM_DATE_READ" }; GridViewExportUtil.ShowExcel(ds.Tables[0], HeaderCaptions, DataColumnsName, "Fbm Read Report", "Fbm Read Report"); }