示例#1
0
        public async Task <byte[]> GeneratePdfReport(StockReport stocks)
        {
            var report = await _jsReport.RenderByNameAsync("StockReport", stocks).ConfigureAwait(false);

            using (var ms = new MemoryStream())
            {
                await report.Content.CopyToAsync(ms).ConfigureAwait(false);

                return(ms.ToArray());
            }
        }
示例#2
0
        public async Task <byte[]> GeneratePdfReport(ProductionReport productionReport)
        {
            var pdf = await _reportingService.RenderByNameAsync("ProductionReport", productionReport).ConfigureAwait(false);

            using (var ms = new MemoryStream())
            {
                await pdf.Content.CopyToAsync(ms).ConfigureAwait(false);

                return(ms.ToArray());
            }
        }