コード例 #1
0
        public static MemoryStream CreateUnattachedCustomerOrderReport(OpenOrdersReportModel model)
        {
            var _reportRepository = new ReportRepository();

            var customerOrders = _reportRepository.GetUnattachedCustomerOrderData(model);

            DataTable customerOrderData = DataTableConverter.ToDataTable(customerOrders);

            var dataSources = new List <ReportDataSource>();
            ReportDataSource customerOrderDataSource = new ReportDataSource("OpenOrdersDS", customerOrderData);

            dataSources.Add(customerOrderDataSource);

            byte[] reportData = ReportViewerManager.ShowPdfReport("CustomerOpenOrdersReport", dataSources);
            var    ms         = new MemoryStream(reportData);

            return(ms);
        }
コード例 #2
0
        public static MemoryStream CreateOpenFoundryOrderReport(OpenOrdersReportModel model)
        {
            var _reportRepository = new ReportRepository();

            var foundryOrders = _reportRepository.GetOpenFoundryOrderData(model);

            DataTable foundryOrderData = DataTableConverter.ToDataTable(foundryOrders);

            var dataSources = new List <ReportDataSource>();
            ReportDataSource foundryOrderDataSource = new ReportDataSource("OpenOrdersDS", foundryOrderData);

            dataSources.Add(foundryOrderDataSource);

            byte[] reportData = ReportViewerManager.ShowPdfReport("FoundryOpenOrdersReport", dataSources);
            var    ms         = new MemoryStream(reportData);

            return(ms);
        }
コード例 #3
0
        public ActionResult OpenFoundryOrderReport(OpenOrdersReportModel model)
        {
            var operationResult = new OperationResult();

            MemoryStream ms = new MemoryStream();

            try
            {
                ms = ReportingManager.CreateOpenFoundryOrderReport(model);
            }
            catch (Exception ex)
            {
                operationResult.Message = "Error occured printing Open Foundry Orders";
                logger.ErrorFormat("Error occured printing Open Foundry Orders: {0} ", ex.ToString());
                this.AddNotification(operationResult.Message, NotificationType.ERROR);
            }

            return(new FileStreamResult(ms, "application/pdf"));
        }