Ejemplo n.º 1
0
        protected void btnexcelDownload_Click(object sender, EventArgs e)
        {
            ModalPopupExtender2.Hide();
            BusinessUnitReportingChild obj = new BusinessUnitReportingChild();
            DataSet        ds = obj.GetSKPickingBoard2("Select One", "Select One", "Select One");
            WorkbookEngine we = new WorkbookEngine();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (!dr.IsNull("ExpirationDate"))
                {
                    dr.Delete();
                }
                //DateTime expirationDate = Convert.ToDateTime(dr["ExpirationDate"].ToString());
            }
            we.ExportDataSetToExcel(ds.Tables[0], "BusinessUnit Reporting");
        }
Ejemplo n.º 2
0
        private void BindGridView()
        {
            int count;
            BusinessUnitReportingChild obj = new BusinessUnitReportingChild();

            string  businessUnitName        = ddlBusinessUnitName.SelectedValue.ToString();
            string  businessUnitManagerName = ddlBusinessUnitManagerName.SelectedValue.ToString();
            string  companyName             = ddlCompanyName.SelectedValue.ToString();
            DataSet ds = obj.GetSKPickingBoard2(businessUnitName, businessUnitManagerName, companyName);// businessUnitManagerName, companyName);// fromDate, toDate, period, fromQuantity, toQuantity, fromAmount, toAmount, adjustmentType, countryName, subBusinessUnitName, companyName, subSegmentName, accountSubTypeName, subCategoryName, rblMeasurementSystemText);

            BusinessUnitGridView.DataSource = ds.Tables[0];
            BusinessUnitGridView.DataBind();
            count = ds.Tables[0].Rows.Count;
            if (count > 1)
            {
                lblRecordCount.Text = "Record Count: " + count;
            }
            else
            {
                lblRecordCount.Text = "Record Count: " + count;
            }
        }