private void ShowBookingDetails(string strStartDate, string strToDate) { bool bIsAll = false; if (drpItemNames.SelectedItem.Text == "All") { bIsAll = true; } grdReport.DataSource = null; grdReport.DataBind(); DataSet ds = BAL.BALFactory.Instance.Bal_Report.GetDataItemReport(Ob, bIsAll); grdReport.DataSource = ds; grdReport.DataBind(); if (grdReport.Rows.Count > 0) { blnRight = AppClass.CheckExportToExcelRightOnPage(); if (blnRight) { btnExport.Visible = true; } else { btnExport.Visible = false; } } AppClass.CalcuateAndSetGridFooter(ref grdReport); }
protected void btnShowReport_Click(object sender, EventArgs e) { ViewState["exlquery"] = null; string strSqlQuery = ""; var DateFromAndTo = hdnDateFromAndTo.Value.Split('-'); strFromDate = DateFromAndTo[0].Trim(); strToDate = DateFromAndTo[1].Trim(); hdnStartDate.Value = strFromDate; hdnEndDate.Value = strToDate; ShowBookingDetails(strFromDate, strToDate); if (grdReport.Rows.Count > 0) { AppClass.CalcuateAndSetGridFooter(ref grdReport); bool blnRight1 = AppClass.CheckExportToExcelRightOnPage(); if (blnRight1) { btnExport.Visible = true; } else { btnExport.Visible = false; } grdReport.Visible = true; ViewState["exlquery"] = strSqlQuery; } else { btnExport.Visible = false; } }
private void BindAndCalculate() { Ob.DatasetMain = BAL.BALFactory.Instance.Bal_Report.GetDailyCustomerAdditionReport(Ob); grdReport.DataSource = Ob.DatasetMain; dataTableGridSource = Ob.DatasetMain.Tables[0]; Ob.DataViewMain = new DataView(Ob.DatasetMain.Tables[0]); ViewState["DataSourceCalc"] = Ob.DatasetMain.Tables[0]; grdReport.DataBind(); CalculatePercent(); AppClass.CalcuateAndSetGridFooter(ref grdReport, 0, 0); }
private void BindAndCalculate() { Ob.DatasetMain = BAL.BALFactory.Instance.Bal_Report.GetCustomerWiseSummary(Ob); grdReport.DataSource = Ob.DatasetMain; dataTableGridSource = Ob.DatasetMain.Tables[0]; Ob.DataViewMain = new DataView(Ob.DatasetMain.Tables[0]); ViewState["DataSourceCalc"] = Ob.DatasetMain.Tables[0]; grdReport.DataBind(); AppClass.CalcuateAndSetGridFooter(ref grdReport, 0, 2); if (grdReport.Rows.Count > 0) { grdReport.FooterRow.Cells[4].Text = ""; } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["BN"] == null || Request.QueryString["BN"] == "") { Response.Redirect("~/Website User/UserLogin.aspx", false); } string BookingNumber = Request.QueryString["BN"].ToString(); string[] data = BookingNumber.Split('-'); string BNumber = data[0].ToString(); string BID = data[1].ToString(); dsMain = BAL.BALFactory.Instance.BAL_Color.BindDeliveryStatus(BNumber, BID); grdItemDetails.DataSource = dsMain; grdItemDetails.DataBind(); if (dsMain.Tables[0].Rows.Count > 0) { AppClass.CalcuateAndSetGridFooter(ref grdItemDetails); } }
protected void btnShowReport_Click(object sender, EventArgs e) { ViewState["exlquery"] = null; string strSqlQuery = ""; var DateFromAndTo = hdnDateFromAndTo.Value.Split('-'); strFromDate = DateFromAndTo[0].Trim(); strToDate = DateFromAndTo[1].Trim(); var isBooking = (drpReportFrom.SelectedItem.Value == "Booking"); ShowBookingDetails(strFromDate, strToDate, isBooking); if (grdReport.Rows.Count > 0) { AppClass.CalcuateAndSetGridFooter(ref grdReport); // btnExport.Visible = true; grdReport.Visible = true; ViewState["exlquery"] = strSqlQuery; } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["Branch"] == null || Request.QueryString["Branch"] == "" || Request.QueryString["UserName"] == null || Request.QueryString["UserName"] == "" || Request.QueryString["BranchName"] == null || Request.QueryString["BranchName"] == "") { Response.Redirect("~/Website User/UserLogin.aspx", false); } else { BranchId = Request.QueryString["Branch"].ToString(); CustCode = Request.QueryString["UserName"].ToString(); BranchName = Request.QueryString["BranchName"].ToString(); dsMain = BAL.BALFactory.Instance.BAL_Color.BindGridCustomerSearch(BranchId, CustCode); grdCustomerWiseReport.DataSource = dsMain; grdCustomerWiseReport.DataBind(); if (dsMain.Tables[0].Rows.Count > 0) { AppClass.CalcuateAndSetGridFooter(ref grdCustomerWiseReport); } } }
protected void ShowReport() { SetData(); Ob.DatasetMain = BAL.BALFactory.Instance.Bal_Report.GetItemWiseSummary(Ob); grdReport.DataSource = Ob.DatasetMain; grdReport.DataBind(); if (grdReport.Rows.Count > 0) { blnRight = AppClass.CheckExportToExcelRightOnPage(); if (blnRight) { btnExport.Visible = true; } else { btnExport.Visible = false; } } //SetCoputedDataSet(Ob, grdReport); AppClass.CalcuateAndSetGridFooter(ref grdReport); }
private void ShowBookingDetails(string strStartDate, string strToDate, string CustId) { DataSet ds = new DataSet(); grdReport.DataSource = null; grdReport.DataBind(); ob.BranchId = Globals.BranchID; ob.FromDate = strStartDate; ob.UptoDate = strToDate; hdnStartDate.Value = strStartDate; hdnEndDate.Value = strToDate; ob.CustId = hdnCustId.Value; ds = BAL.BALFactory.Instance.Bal_Report.GetInvoiceStatement(ob); try { grdReport.DataSource = ds; grdReport.DataBind(); hdntmpColCount.Value = ds.Tables[0].Columns.Count.ToString(); AppClass.CalcuateAndSetGridFooter(ref grdReport); DataColumnCollection columns = ds.Tables[0].Columns; int colIndex = -1; if (columns.Contains("Rate")) { colIndex = columns.IndexOf("Rate"); } grdReport.FooterRow.Cells[colIndex].Text = ""; btnExport.Visible = true; grdReport.FooterRow.BackColor = System.Drawing.Color.Silver; grdReport.FooterRow.Font.Bold = true; btnInvoicePrint.Visible = true; } catch (Exception e) { grdReport.DataSource = null; grdReport.DataBind(); btnExport.Visible = false; btnInvoicePrint.Visible = false; } }
private void ShowBookingDetails(string strStartDate, string strToDate) { grdReport.DataSource = null; grdReport.DataBind(); DataSet dsMain = new DataSet(); DTO.Report ObMain = new DTO.Report(); ObMain.FromDate = strStartDate; ObMain.UptoDate = strToDate; ObMain.CustCodeStr = txtAreaLocation.Text; ObMain.BranchId = Globals.BranchID; dsMain = BAL.BALFactory.Instance.Bal_Report.GetDataMainReportAreaLocation(ObMain); if (dsMain.Tables.Count > 0) { if (dsMain.Tables[0].Rows.Count > 0) { grdReport.DataSource = dsMain.Tables[0]; grdReport.DataBind(); AppClass.CalcuateAndSetGridFooter(ref grdReport); grdReport.FooterRow.Cells[4].Text = ""; } } }
protected void ShowReport() { grdReport.DataSource = null; grdReport.DataBind(); Ob.DatasetMain = BAL.BALFactory.Instance.Bal_Report.GetDurationWiseReport(Ob); if (Ob.DatasetMain == null || Ob.DatasetMain.Tables.Count == 0 || Ob.DatasetMain.Tables[0].Rows.Count == 0) { return; } // SetComputedColumn(Ob, grdReport); grdReport.DataSource = Ob.DatasetMain; grdReport.DataBind(); blnRight = AppClass.CheckExportToExcelRightOnPage(); if (blnRight) { btnExport.Visible = true; } else { btnExport.Visible = false; } AppClass.CalcuateAndSetGridFooter(ref grdReport); }
protected void btnShowReport_Click(object sender, EventArgs e) { ViewState["exlquery"] = null; string strReportCaption = string.Empty, strSqlQuery = string.Empty; string strFromDate = string.Empty, strToDate = string.Empty, strGridCap = string.Empty; if (radReportFrom.Checked) { //strFromDate = txtReportFrom.Text + " 00:00:00"; if (txtReportUpto.Text == "") { txtReportUpto.Text = txtReportFrom.Text; } DateTime dt = DateTime.Parse(txtReportUpto.Text); //strToDate = dt.ToShortDateString() + " 00:00:00"; DateTime dt1 = DateTime.Parse(txtReportFrom.Text); DateTime dt2 = DateTime.Parse(txtReportUpto.Text); strFromDate = txtReportFrom.Text + " 00:00:00"; strToDate = txtReportUpto.Text + " 00:00:00"; strGridCap = "Expense Report from " + dt1.ToString("dd-MMM-yyyy") + " to " + dt2.ToString("dd-MMM-yyyy"); } else if (radReportMonthly.Checked) { DateTime dt = new DateTime(int.Parse(drpYearList.SelectedItem.Text), int.Parse(drpMonthList.SelectedItem.Value), 1); strFromDate = dt.ToShortDateString() + " 00:00:00"; strToDate = dt.AddMonths(1).ToShortDateString() + " 00:00:00"; strGridCap = "Expense Report for " + drpMonthList.SelectedItem.Text + ", " + drpYearList.SelectedItem.Text; } DateTime dtStart = DateTime.Parse(strFromDate); DateTime dtEnd = DateTime.Parse(strToDate); DataTable dtTmp = new DataTable(); DataSet ds = new DataSet(); SqlDataAdapter sadp = new SqlDataAdapter(); if (drpExpReportType.SelectedValue == "1") { dtTmp = new DataTable(); dtTmp.Columns.Add("Expense Date"); dtTmp.Columns.Add("Amount"); } else if (drpExpReportType.SelectedValue == "2") { dtTmp = new DataTable(); dtTmp.Columns.Add("Expense Date"); dtTmp.Columns.Add("Particulars"); dtTmp.Columns.Add("Account Type"); dtTmp.Columns.Add("Amount"); } SqlConnection sqlcon = new SqlConnection(PrjClass.sqlConStr); try { for (DateTime dt = dtStart; dt <= dtEnd; dt = dt.AddDays(1)) { if (drpExpReportType.SelectedValue == "1") { if (drpLedger.SelectedItem.Text == "All") { strSqlQuery = "SELECT '" + dt.ToString("dd MMM yyyy") + "' As Expense_Date, SUM(Credit) As Amount FROM EntLedgerEntries WHERE (LedgerName = 'CASH') AND (Particulars Like 'To %') AND TransDate='" + dt.ToString("dd/MMM/yyyy") + "' AND BranchId='" + Globals.BranchID + "' GROUP BY LedgerName"; } else { strSqlQuery = "SELECT '" + dt.ToString("dd MMM yyyy") + "' As Expense_Date, SUM(Credit) As Amount FROM EntLedgerEntries WHERE (LedgerName = 'CASH') AND (Particulars Like 'To %') AND TransDate='" + dt.ToString("dd/MMM/yyyy") + "' AND BranchId='" + Globals.BranchID + "' AND Particulars='" + "To " + drpLedger.SelectedItem.Text + "' GROUP BY LedgerName"; } } else if (drpExpReportType.SelectedValue == "2") { if (drpLedger.SelectedItem.Text == "All") { strSqlQuery = "SELECT '" + dt.ToString("dd MMM yyyy") + "' As Expense_Date, 'Paid '+Particulars+' ('+Narration+') ' As Particulars, SUBSTRING(Particulars,4,LEN(Particulars)) As [Account Type], SUM(Credit) As Amount FROM EntLedgerEntries WHERE (LedgerName = 'CASH') AND (Particulars Like 'To %') AND TransDate='" + dt.ToString("dd/MMM/yyyy") + "' AND BranchId='" + Globals.BranchID + "' GROUP BY LedgerName, Particulars,Narration"; } else { strSqlQuery = "SELECT '" + dt.ToString("dd MMM yyyy") + "' As Expense_Date, 'Paid '+Particulars+' ('+Narration+') ' As Particulars, SUBSTRING(Particulars,4,LEN(Particulars)) As [Account Type], SUM(Credit) As Amount FROM EntLedgerEntries WHERE (LedgerName = 'CASH') AND (Particulars Like 'To %') AND TransDate='" + dt.ToString("dd/MMM/yyyy") + "' AND BranchId='" + Globals.BranchID + "' AND Particulars='" + "To " + drpLedger.SelectedItem.Text + "' GROUP BY LedgerName, Particulars,Narration"; } } sadp = new SqlDataAdapter(strSqlQuery, sqlcon); ds = new DataSet(); sadp.Fill(ds); if (ds.Tables.Count > 0) { for (int r = 0; r < ds.Tables[0].Rows.Count; r++) { DataRow dr = dtTmp.NewRow(); for (int c = 0; c < ds.Tables[0].Columns.Count; c++) { dr[c] = ds.Tables[0].Rows[r][c].ToString(); } dtTmp.Rows.Add(dr); } } } } catch (Exception excp) { lblMsg.Text = "Error:" + excp.Message; } finally { sqlcon.Close(); } grdReport.DataSource = dtTmp; grdReport.DataBind(); grdReport.Visible = true; if (grdReport.Rows.Count > 0) { //CalculateGridReport(); AppClass.CalcuateAndSetGridFooter(ref grdReport); btnExport.Visible = true; if (radReportFrom.Checked) { strGridCap = "Expense Report from " + txtReportFrom.Text + " to " + txtReportUpto.Text; } else if (radReportMonthly.Checked) { strGridCap = "Expense Report for " + drpMonthList.SelectedItem.Text + ", " + drpYearList.SelectedItem.Text; } } else { btnExport.Visible = false; strGridCap = ""; } grdReport.Caption = strGridCap; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "googlechart();", true); }
private void ShowBookingDetails(string strStartDate, string strToDate) { grdReport.DataSource = null; grdReport.DataBind(); DTO.Report.BFlag = false; if (!HttpContext.Current.Items.Contains("IsPrintingForMany")) { HttpContext.Current.Items.Add("IsPrintingForMany", "false"); } else { HttpContext.Current.Items["IsPrintingForMany"] = "false"; } hdnDTOReportsBFlag.Value = "false"; DTO.Report ObMain = new DTO.Report(); ObMain.FromDate = strStartDate; ObMain.UptoDate = strToDate; ObMain.InvoiceNo = txtInvoiceNo.Text; ObMain.BranchId = Globals.BranchID; ObMain.CustId = lblCustomerCode.Text; if (txtInvoiceNo.Text.Trim() != "") { ObMain.Description = "3"; } else if (txtCustomerName.Text.Trim() != "") { ObMain.Description = "2"; } else { ObMain.Description = "1"; } DataSet dsMain = new DataSet(); dsMain = BAL.BALFactory.Instance.Bal_Report.GetCancelDataMainReport(ObMain); string res = BAL.BALFactory.Instance.BAL_RemoveReason.GetDateTime(Globals.BranchID); var dt = dsMain.Tables[0].Clone(); if (chkShowOnlyHome.Checked) { for (var i = 0; i < dsMain.Tables[0].Rows.Count; i++) { if (dsMain.Tables[0].Rows[i]["HomeDelivery"].ToString() == "Yes") { dt.ImportRow(dsMain.Tables[0].Rows[i]); } } } try { if (chkShowOnlyHome.Checked /*dt.Rows.Count >= 1*/) { var tempTable = dsMain.Tables[1].Copy(); dsMain.Tables.RemoveAt(0); dsMain.Tables.RemoveAt(0); dsMain.Tables.Add(dt); dsMain.Tables.Add(tempTable); } if (dsMain.Tables.Count > 0) { if (dsMain.Tables[0].Rows.Count > 0) { if (dsMain.Tables[0].Columns[0].ColumnName == "Error") { throw new Exception(dsMain.Tables[0].Rows[0][1].ToString()); } grdReport.DataSource = dsMain.Tables[0]; grdReport.DataBind(); ReportViewer1.LocalReport.ReportPath = "RDLC/BookingReport.rdlc"; ReportDataSource rds = new ReportDataSource(); ReportParameter[] parameters = new ReportParameter[4]; parameters[0] = new ReportParameter("UserName", Globals.UserName); parameters[1] = new ReportParameter("GeneratedDate", "@" + " " + DateTime.Today.ToString("dd MMM yyyy") + " " + res); parameters[2] = new ReportParameter("FDate", strStartDate); parameters[3] = new ReportParameter("LDate", strToDate); //parameters[2] = new ReportParameter("Link", str); ReportViewer1.LocalReport.SetParameters(parameters); rds.Name = "DataSet1"; rds.Value = dsMain.Tables[0]; ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(rds); ReportViewer1.LocalReport.Refresh(); DTO.Report.BFlag = false; if (!HttpContext.Current.Items.Contains("IsPrintingForMany")) { HttpContext.Current.Items.Add("IsPrintingForMany", "false"); } else { HttpContext.Current.Items["IsPrintingForMany"] = "false"; } hdnDTOReportsBFlag.Value = "false"; gvUserInfo.DataSource = dsMain.Tables[1]; gvUserInfo.DataBind(); AppClass.CalcuateAndSetGridFooter(ref grdReport); CalculatePrintGridReport(); var UserType = Globals.UserType; if (UserType == "1") { grdReport.FooterRow.Visible = true; gvUserInfo.FooterRow.Visible = true; } else { grdReport.FooterRow.Visible = false; gvUserInfo.FooterRow.Visible = false; } } } } catch (Exception excp) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "setDivMouseOver('Red', '#999999');", true); lblMsg.Text = "Error : " + excp.Message; } finally { } }
private void ShowBookingDetails(string strStartDate, string strToDate, bool bIsBooking = true) { DataSet ds = new DataSet(); grdReport.DataSource = null; grdReport.DataBind(); ob.BranchId = Globals.BranchID; ob.FromDate = strStartDate; ob.UptoDate = strToDate; hdnFromDate.Value = ob.FromDate; hdnToDate.Value = ob.UptoDate; ob.InvoiceNo = (bIsBooking) ? "1" : "2"; if (drpReportFrom.SelectedItem.Value == "Summarised Booking") { ob.InvoiceNo = "3"; } else if (drpReportFrom.SelectedItem.Value == "Summarised Delivery") { ob.InvoiceNo = "4"; } ds = BAL.BALFactory.Instance.Bal_Report.BindServiceTax(ob); if (ob.InvoiceNo == "3" || ob.InvoiceNo == "4") { grdReportSummary.DataSource = ds; grdReport.DataSource = null; grdReport.Visible = false; grdReportSummary.Visible = true; } else { grdReportSummary.DataSource = null; grdReport.DataSource = ds; grdReport.Visible = true; grdReportSummary.Visible = false; } grdReportSummary.DataBind(); grdReport.DataBind(); blnRight = AppClass.CheckExportToExcelRightOnPage(); if (blnRight) { btnExport.Visible = true; if (ds.Tables[0].Rows.Count > 0) { btnExport.Visible = true; } else { btnExport.Visible = false; } } else { btnExport.Visible = false; } if (ds.Tables[0].Rows.Count > 0) { btnPrint.Visible = true; } else { btnPrint.Visible = false; } ds = BAL.BALFactory.Instance.Bal_Report.BindServiceTax(ob); string res = BAL.BALFactory.Instance.BAL_RemoveReason.GetDateTime(Globals.BranchID); if (grdReport.Rows.Count > 0) { //CalculateGridReport(); AppClass.CalcuateAndSetGridFooter(ref grdReport); } else if (grdReportSummary.Rows.Count > 0) { //CalculateGridReportSummary(); AppClass.CalcuateAndSetGridFooter(ref grdReportSummary, 0, drpReportFrom.SelectedItem.Value == "Summarised Booking" ? 1 : 2); } if (ds.Tables[0].Rows.Count > 0) { if (ob.InvoiceNo == "1") { ReportViewer1.LocalReport.ReportPath = "RDLC/BookingServiceTax.rdlc"; } else if (ob.InvoiceNo == "2") { ReportViewer1.LocalReport.ReportPath = "RDLC/DeliveryServiceTax.rdlc"; } else if (ob.InvoiceNo == "3") { ReportViewer1.LocalReport.ReportPath = "RDLC/SumBookingServiceTax.rdlc"; } else { ReportViewer1.LocalReport.ReportPath = "RDLC/SumDeliveryServiceTax.rdlc"; } ReportDataSource rds = new ReportDataSource(); ReportParameter[] parameters = new ReportParameter[7]; parameters[0] = new ReportParameter("UserName", Globals.UserName); parameters[1] = new ReportParameter("GeneratedDate", "@" + " " + DateTime.Today.ToString("dd MMM yyyy") + " " + res); parameters[2] = new ReportParameter("FromDate", ob.FromDate); parameters[3] = new ReportParameter("ToDate", ob.UptoDate); parameters[4] = new ReportParameter("Tax1", _LabelTax1); parameters[5] = new ReportParameter("Tax2", _LabelTax2); parameters[6] = new ReportParameter("Tax3", _LabelTax3); //parameters[2] = new ReportParameter("Link", str); ReportViewer1.LocalReport.SetParameters(parameters); rds.Name = "DataSet1"; rds.Value = ds.Tables[0]; ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(rds); ReportViewer1.LocalReport.Refresh(); } }
private void ShowBookingDetails(string strStartDate, string strToDate) { grdReport.DataSource = null; grdReport.DataBind(); btnExport.Visible = false; DTO.Report.BFlag = false; if (!HttpContext.Current.Items.Contains("IsPrintingForMany")) { HttpContext.Current.Items.Add("IsPrintingForMany", "false"); } else { HttpContext.Current.Items["IsPrintingForMany"] = "false"; } hdnDTOReportsBFlag.Value = "false"; DTO.Report ObMain = new DTO.Report(); ObMain.FromDate = strStartDate; ObMain.UptoDate = strToDate; ObMain.InvoiceNo = txtInvoiceNo.Text; ObMain.BranchId = Globals.BranchID; if (txtInvoiceNo.Text != "") { ObMain.Description = "6"; } else { ObMain.Description = "5"; } DataSet dsMain = new DataSet(); dsMain = BAL.BALFactory.Instance.Bal_Report.GetDataMainReport(ObMain); try { if (dsMain.Tables.Count > 0) { if (dsMain.Tables[0].Rows.Count > 0) { if (dsMain.Tables[0].Columns[0].ColumnName == "Error") { throw new Exception(dsMain.Tables[0].Rows[0][1].ToString()); } grdReport.DataSource = dsMain.Tables[0]; grdReport.DataBind(); DTO.Report.BFlag = false; if (!HttpContext.Current.Items.Contains("IsPrintingForMany")) { HttpContext.Current.Items.Add("IsPrintingForMany", "false"); } else { HttpContext.Current.Items["IsPrintingForMany"] = "false"; } hdnDTOReportsBFlag.Value = "false"; ViewState["SavedDS"] = dsMain; AppClass.CalcuateAndSetGridFooter(ref grdReport); bool blnRight = AppClass.CheckExportToExcelRightOnPage(); if (blnRight) { btnExport.Visible = true; } else { btnExport.Visible = false; } } } } catch (Exception excp) { lblErr.Text = "Error : " + excp.Message; } finally { txtInvoiceNo.Focus(); } }