protected void btn_genRpt_Click(object sender, EventArgs e) { string yrmo = ddlYrmo.SelectedItem.Text; DataSet ds = new DataSet(); DataSet dsFinal = new DataSet(); ds.Clear(); dsFinal.Clear(); string[][] cols = { new string[] { "YRMO", "EBA Count", "EBA Amount", "Anthem Count", "Anthem Amount", "EBA Count Variance", "EBA vs Anthem % Count Variance", "Threshold", "Threshold Level" }, new string[] { "YRMO", "Source", "EBA Count", "Anthem Count" } }; string[][] colsFormat = { new string[] { "string", "number", "decimal", "number", "decimal", "number", "decimal", "decimal", "string" }, new string[] { "string", "string", "number", "number" } }; string[] sheetnames = { "EAP", "EAP_Count_Details" }; string[] titles = { "EAP Billing Reconciliation for YRMO - " + yrmo, "EAP Billing Headcounts Detail for YRMO - " + yrmo }; try { ds = ReconDAL.GetEAPReconData(yrmo); ds.Tables[0].TableName = "eapTable"; dsFinal.Tables.Add(ds.Tables[0].Copy()); dsFinal.Tables[0].TableName = "eapTableF"; ds.Clear(); ds = ReconDAL.GetEAPReconDetails(yrmo); ds.Tables[0].TableName = "detTable"; dsFinal.Tables.Add(ds.Tables[0].Copy()); dsFinal.Tables[1].TableName = "detTableF"; ds.Clear(); ExcelReport.ExcelXMLRpt(dsFinal, "EAPRecon_" + yrmo, sheetnames, titles, cols, colsFormat); } catch (Exception ex) { MultiView1.SetActiveView(view_main); lbl_error.Text = "Error in generating excel report" + ex.Message; } }
private void SortGridView(string sortExpression, string direction) { // You can cache the DataTable for improving performance string yrmo = ddlYrmo.SelectedItem.Text; DataTable dt = ReconDAL.GetEAPReconData(yrmo).Tables[0]; DataView dv = new DataView(dt); dv.Sort = sortExpression + direction; grdvResult.DataSource = dv; grdvResult.DataBind(); }
protected void bindResult() { DataSet ds = new DataSet(); string yrmo = ddlYrmo.SelectedItem.Text; ds = ReconDAL.GetEAPReconData(yrmo); if (ds.Tables[0].Rows.Count > 0) { resultDiv.Visible = true; grdvResult.DataSource = ds; grdvResult.DataBind(); } else { resultDiv.Visible = false; } }