public ReportClass GetReport(tblDocumentCommon doc, List <DocumentAdapter> reportSource = null) { List <DocumentAdapter> xSource = reportSource; if (xSource == null) { DocumentAdapter xPrintAdapter = new DocumentAdapter(doc); xSource = new List <DocumentAdapter>(1); xSource.Add(xPrintAdapter); } ReportClass xReport; if (doc is tblDocumentService) { xReport = new DocService(); } else if (doc is tblDocumentProduct) { xReport = new DocSale(); } else if (doc is tblDocumentSalesReceipt) { xReport = new SaleReceipt(); } else { throw new Exception("Не определен шаблон документа"); } xReport.SetDataSource(xSource); return(xReport); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { DocSale rpt = new DocSale(); rpt.Site = this.Site; return(rpt); }