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

            rpt.Site = this.Site;
            return(rpt);
        }
Пример #2
0
        private void ReportViewer_Load(object sender, EventArgs e)
        {
            ReportClass report = null;

            switch (type)
            {
            case 0:
            case 1:
                if (type == 0)
                {
                    report = new View.Reports.ExecutedReport();
                    report.Refresh();
                    report.SetDataSource((IEnumerable <ExecutedPurchaseReport>)objects);
                }
                else
                {
                    var  priceReportData = (List <PriceReport>)objects;
                    long total           = 0;
                    priceReportData.ForEach(d => total += d.Summa);
                    report = new View.Reports.PriceReport();
                    report.Refresh();
                    report.SetDataSource((IEnumerable <PriceReport>)objects);
                    report.SetParameterValue("Total", $"{total} руб.");
                }
                report.SetParameterValue("First", first.Value.ToShortDateString());
                report.SetParameterValue("Second", second.Value.ToShortDateString());
                break;

            case 2:
                report = new View.Reports.ServiceTypeReport();
                report.Refresh();
                report.SetDataSource((IEnumerable <ServiceType>)objects);
                break;

            default:
                break;
            }
            crystalReportViewer1.ReportSource = report;
        }