protected void btnExport_Click(object s, EventArgs e) { int is_Fetch_Count = 0; DataTable dtexportdata = BLL_PURC_CTP.Get_Ctp_Contract_Details(Convert.ToInt32(Request.QueryString["Quotation_ID"]), UDFLib.ConvertToInteger(rbtnApprStatus.SelectedValue), UDFLib.ConvertStringToNull(txtItemsDesc.Text), UDFLib.ConvertStringToNull(ddlSubCatalogue.SelectedValue), null, null, ref is_Fetch_Count ); string[] HeaderCaptions = new string[] { "Sub Catalogue", "Part No.", "Short Desc.", "Long Desc.", "Unit", "Offer Unit", "Unit Price", "Discount", "Final Unit Price" }; string[] DataColumnsName = new string[] { "Subsystem_Description", "Part_Number", "Short_Description", "Long_Description", "Unit_and_Packings", "unit", "Rate", "Discount", "net_price" }; string FileHeaderName = @"<table border='1' cellpadding='3' style='border-collapse:collapse;background-color:#F2F2F2;margin-left:10px;' > <tr><td style='font-weight:bold;text-align:right'>Dept Name :</td><td >" + lblDepartment.Text + " </td><td style='font-weight:bold;text-align:right' >Catalogue :</td> <td>" + lblCatalogue.Text + " </td><td style='font-weight:bold;text-align:right'>Contract Code :</td> <td>" + lblSeachangeRef.Text + " </td> </tr>" + "<tr> <td style='font-weight:bold;text-align:right'>Supplie Name :</td><td>" + lblSupplierName.Text + " </td> <td style='font-weight:bold;text-align:right'>Port :</td><td>" + lblPort.Text + " </td><td style='font-weight:bold;text-align:right'>Supplier Ref No.: </td><td> " + lblSupplierRef.Text + " </td> </tr></table>"; string FileName = lblSeachangeRef.Text; GridViewExportUtil.ShowExcel(dtexportdata, HeaderCaptions, DataColumnsName, FileName, FileHeaderName); }
protected void BindDataItems() { if (IsPostBack && hdf_Quotation_Save_Status.Value == "0") { SaveItemPrice(); } int is_Fetch_Count = ucCustomPagerctp.isCountRecord; gvContractDetails.DataSource = BLL_PURC_CTP.Get_Ctp_Contract_Details(Convert.ToInt32(Request.QueryString["Quotation_ID"]), UDFLib.ConvertToInteger(rbtnApprStatus.SelectedValue), UDFLib.ConvertStringToNull(txtItemsDesc.Text), UDFLib.ConvertStringToNull(ddlSubCatalogue.SelectedValue), ucCustomPagerctp.CurrentPageIndex, ucCustomPagerctp.PageSize, ref is_Fetch_Count ); gvContractDetails.DataBind(); if (ucCustomPagerctp.isCountRecord == 1) { ucCustomPagerctp.CountTotalRec = is_Fetch_Count.ToString(); ucCustomPagerctp.BuildPager(); } }