private void btnPrint_Click(object sender, EventArgs e)
 {
     if (cmbServiceID.Text != null && fldName.Text != "" && dtValue.Text != null)
     {
         var reportViewer = new ReportViewer();
         reportViewer.HeaderWidthPercent = 100;
         reportViewer.ContentWidthPercent = 100;
         reportViewer.RowsPerPage = 30;
         //reportViewer.HeaderContent = string.Format("<h2 style='margin-left:100px'>Daily Collection Report for the Date of {0:dd/MM/yyyy}</h2>", this.dtpFromDate.Value);
         reportViewer.HeaderContent = string.Format("<div style='float: left; width: 350px;'>Date : {0: dd-MM-YYYY} </div>", dtValue.Text);
         reportViewer.GenerateFromGridView(this.dgvServiceReport, false);
         reportViewer.Show(this);
     }
     else
     {
         if (cmbServiceID.Text != null)
         {
             MessageBox.Show("Select Service");
         }
         else if (fldName.Text != null)
         {
             MessageBox.Show("Select CreatedOn / ServicePerformDate");
         }
         else if (dtValue.Text != null)
         {
             MessageBox.Show("Select Date");
         }
     }
 }
 private void btnPrint_Click(object sender, EventArgs e)
 {
     var reportViewer = new ReportViewer();
     reportViewer.HeaderWidthPercent = 100;
     reportViewer.ContentWidthPercent = 100;
     reportViewer.RowsPerPage = 30;
     //reportViewer.HeaderContent = string.Format("<h2 style='margin-left:100px'>Daily Collection Report for the Date of {0:dd/MM/yyyy}</h2>", this.dtpFromDate.Value);
     reportViewer.HeaderContent = string.Format("<div style='float: left; width: 350px;'>Batch : {0} </div> <div style='float: left;'>Time : {1:h:mm:s tt}</div>", BatchIdVal.ToString(), BatchTimeVal);
     reportViewer.GenerateFromGridView(this.dgvBatchDetails, false);
     reportViewer.Show(this);
 }
 private void btnPrint_Click(object sender, EventArgs e)
 {
     var reportViewer = new ReportViewer();
     reportViewer.HeaderWidthPercent = 100;
     reportViewer.ContentWidthPercent = 100;
     reportViewer.RowsPerPage = 30;
     //reportViewer.HeaderContent = string.Format("<h2 style='margin-left:100px'>Daily Collection Report for the Date of {0:dd/MM/yyyy}</h2>", this.dtpFromDate.Value);
     reportViewer.HeaderContent = string.Format("<div style='float: left; width: 350px;'>Date : {0: dd-MM-YYYY} </div>", dtval);
     reportViewer.GenerateFromGridView(this.dgvServiceReport, false);
     reportViewer.Show(this);
 }
 private void btnPrint_Click(object sender, EventArgs e)
 {
     var reportViewer = new ReportViewer();
     reportViewer.HeaderWidthPercent = 100;
     reportViewer.ContentWidthPercent = 100;
     reportViewer.RowsPerPage = 30;
     var duration = dtpDate.Value;
     var cUser = cmbUsername.Text;
     reportViewer.HeaderContent = string.Format("<center><h2>Daily Collection Report for the Date of {0:dd/MM/yyyy} of {1}</h2></center>", this.dtpDate.Value, cUser);
     reportViewer.GenerateFromGridView(this.dgvOperatorReport, true);
     reportViewer.MdiParent = this.MdiParent;
     reportViewer.Show();
 }
Exemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            var VIPDaoObj = new VIPPrasadamDao();
            var abc = VIPDaoObj.GetDaycount(this.dtpFromDate.Value);
            var dt1 = String.Format("{0:dd-MM-yyyy}", this.dtpFromDate.Value);
            int i = 0;
            String VIPContent = "అతిధి సత్కారం కొరకు " + dt1 + " తేదిన వినియోగించిన సరుకు వివరములు : ";
            while (i < abc.Count)
            {
                var xyz = abc[i] as VIPPrasadam;
                VIPContent = VIPContent + xyz.ServiceName + " " + xyz.Qty;
                i = i + 1;
                if (i < abc.Count)
                {
                    VIPContent = VIPContent + ", ";
                }
            }
            if (abc.Count == 0)
            {
                VIPContent = "";
            }

            DateTime cdatetime = DateTime.Now;
            var cdt = String.Format("{0:dd-MM-yyyy h:mm tt}", cdatetime);
            var DCRGenDT = "Generated on : " + cdt;
            var reportViewer = new ReportViewer();
            reportViewer.HeaderWidthPercent = 100;
            reportViewer.ContentWidthPercent = 100;
            reportViewer.RowsPerPage = 30;

            var duration = dtpToDate.Value - dtpFromDate.Value;

            if (duration.Days > 0)
            {
                reportViewer.HeaderContent = string.Format("<center><h2>Daily Collection Report from {0:dd/MM/yyyy} to {1:dd/MM/yyyy}</h2></center>", this.dtpFromDate.Value, this.dtpToDate.Value);
            }
            else
            {
                reportViewer.HeaderContent = string.Format("<center><h2>Daily Collection Report for the Date of {0:dd/MM/yyyy}</h2></center>", this.dtpFromDate.Value);
            }
            if (VIPContent != "")
            {
                reportViewer.FooterContent = string.Format("<span><br />{0}</span>", VIPContent);
            }

            var tokenDAO = new TokenDao();
            Double CashDt = tokenDAO.GEtTotalCostByTransactionType(dtpFromDate.Value, dtpToDate.Value, "Cash");
            Double CardDt = tokenDAO.GEtTotalCostByTransactionType(dtpFromDate.Value, dtpToDate.Value, "Credit/Debit Card");
            Double DDDt = tokenDAO.GEtTotalCostByTransactionType(dtpFromDate.Value, dtpToDate.Value, "DD");
            Double ChequeDt = tokenDAO.GEtTotalCostByTransactionType(dtpFromDate.Value, dtpToDate.Value, "Cheque");
            var DCRCashDT = "Amount from Cash Transactions : Rs." + CashDt + "/-";
            var DCRCardDT = "Amount from Card Transactions : Rs." + CardDt + "/-";
            var DCRDDDT = "Amount from DD Transactions : Rs." + DDDt + "/-";
            var DCRChequeDT = "Amount from Cheque Transactions : Rs." + ChequeDt + "/-";

            reportViewer.FooterContent = reportViewer.FooterContent + string.Format("<span><br />{0}</span>", DCRGenDT);

            reportViewer.FooterContent = reportViewer.FooterContent + string.Format("<span><br />{0}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{1}</span>", DCRCashDT, DCRCardDT);
            reportViewer.FooterContent = reportViewer.FooterContent + string.Format("<span><br />{0}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{1}</span>", DCRDDDT, DCRChequeDT);

            reportViewer.GenerateFromGridView(this.dgvReport, false);
            reportViewer.Show(this);
        }