Example #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crClientVoucher rpt = new crClientVoucher();

            rpt.Site = this.Site;
            return(rpt);
        }
Example #2
0
        private void ShowReport()
        {
            _branchId      = GlobalVariableBO._branchId;
            _paymentDate   = Convert.ToDateTime(dtPaymentDate.Value.ToShortDateString());
            _clientVoucher = rdoClinetVoucher.Checked;
            _officevoucher = rdoOfficevoucher.Checked;
            VoucherPrintingBAL voucherPrintingBal = new VoucherPrintingBAL();
            DataTable          dtVoucherPrint     = new DataTable();
            LoadCommonInfo     CmmInfo            = new LoadCommonInfo();

            if (_clientVoucher)
            {
                crClientVoucher             crClientvoucher             = new crClientVoucher();
                ClientVoucherPrintingViewer clientVoucherPrintingViewer = new ClientVoucherPrintingViewer();
                dtVoucherPrint = voucherPrintingBal.GetClientVoucher(_paymentDate);
                crClientvoucher.SetDataSource(dtVoucherPrint);
                ///// Load Company Name
                ((TextObject)crClientvoucher.ReportDefinition.Sections[3].ReportObjects["txtCompanyName"]).Text = CmmInfo.ShowCompanyName();

                ///// Load Branch Name
                ((TextObject)crClientvoucher.ReportDefinition.Sections[3].ReportObjects["txtBranchName"]).Text = CmmInfo.BranchDetails(_branchId);
                clientVoucherPrintingViewer.crvClientVoucherViewer.ReportSource = crClientvoucher;
                clientVoucherPrintingViewer.Show();
            }
            else if (_officevoucher)
            {
                crOfficeVoucher             crOfficevoucher             = new crOfficeVoucher();
                OfficeVoucherPrintingViewer officeVoucherPrintingViewer = new OfficeVoucherPrintingViewer();
                dtVoucherPrint = voucherPrintingBal.GetClientVoucher(_paymentDate);
                crOfficevoucher.SetDataSource(dtVoucherPrint);
                ///// Load Company Name
                ((TextObject)crOfficevoucher.ReportDefinition.Sections[3].ReportObjects["txtCompanyName"]).Text = CmmInfo.ShowCompanyName();

                ///// Load Branch Name
                ((TextObject)crOfficevoucher.ReportDefinition.Sections[3].ReportObjects["txtBranchName"]).Text = CmmInfo.BranchDetails(_branchId);
                officeVoucherPrintingViewer.crvOfficeVoucherViewer.ReportSource = crOfficevoucher;
                officeVoucherPrintingViewer.Show();
            }
            else
            {
                MessageBox.Show("Please Select the report category first.");
            }
        }