Пример #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            SupplierDeductionRegisterRPT rpt = new SupplierDeductionRegisterRPT();

            rpt.Site = this.Site;
            return(rpt);
        }
Пример #2
0
        private void btnDeductRegister_Click(object sender, EventArgs e)
        {
            DataTable dsReport = new DataTable();

            dsReport = mySupplierDeduction.GetDeductionRegister().Tables[0];
            if (dsReport.Rows.Count > 0)
            {
                dsReport.WriteXml("SuppliyerDeductionRegister.xml");
                SupplierDeductionRegisterRPT myReport = new SupplierDeductionRegisterRPT();
                myReport.SetDataSource(dsReport);
                ReportViewer rptViewer = new ReportViewer();
                myReport.SetParameterValue("Company", BoughtLeafBusinessLayer.BLUser.getCompanyName());
                rptViewer.crystalReportViewer1.ReportSource = myReport;
                rptViewer.Show();
            }
            else
            {
                MessageBox.Show("No Data To Preview.");
            }
        }