protected void BtnGenerateReport_Click(object sender, EventArgs e) { try { //if (ddlStoreName.SelectedItem.Text != "---Select---") //{ // string type = RBLReport.SelectedValue; // Hashtable ht = new Hashtable(); // ht.Add("Type", RBLReport.SelectedValue); // ht.Add("DateFrom", txtFrom.Text); // ht.Add("DateTo", txtTo.Text); // ht.Add("SupplierCode", ddlSupplier.SelectedValue); // ht.Add("ChallanNo", txtMRRNo.Text); // ht.Add("ProductGroupId", ddlItemGroup.SelectedValue); // ht.Add("ProductId", ddlItemName.SelectedValue); // ht.Add("StoreCode", ddlStoreName.SelectedValue); // DataTable dt = new DataTable(); // dt = rpt.GetPurchaseReportDataWithStore(ht); // BindReport(dt, type); //} if (txtFrom.Text != " " && txtTo.Text != "" && ddlSupplier.SelectedItem.Text != "Select One") { string type = RBLReport.SelectedValue; Hashtable ht = new Hashtable(); ht.Add("Type", RBLReport.SelectedValue); ht.Add("DateFrom", txtFrom.Text); ht.Add("DateTo", txtTo.Text); ht.Add("SupplierCode", ddlSupplier.SelectedValue); DataTable dt = new DataTable(); dt = rpt.GetReturnFromSupplier_BySupplier(ht); if (dt.Rows.Count > 0) { BindReport(dt, type); } else { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('No Data Found!')", true); } } else if (txtFrom.Text != " " && txtTo.Text != "" && ddlDepartment.SelectedItem.Text != "Select One") { string type = RBLReport.SelectedValue; Hashtable ht = new Hashtable(); ht.Add("Type", RBLReport.SelectedValue); ht.Add("DateFrom", txtFrom.Text); ht.Add("DateTo", txtTo.Text); ht.Add("EID", ddlReciver.SelectedValue); DataTable dt = new DataTable(); dt = rpt.GetReturnFromDept_ByEmp(ht); if (dt.Rows.Count > 0) { BindReport(dt, type); } else { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('No Data Found!')", true); } } else { string type = RBLReport.SelectedValue; Hashtable ht = new Hashtable(); ht.Add("Type", RBLReport.SelectedValue); ht.Add("DateFrom", txtFrom.Text); ht.Add("DateTo", txtTo.Text); DataTable dt = new DataTable(); dt = rpt.GetReturnToSupplier_Store_ByDate(ht); if (dt.Rows.Count > 0) { BindReport(dt, type); } else { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('No Data Found!')", true); } } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }