jsreport/jsreport-dotnet-aspnetcore

Save report to a File

hieutran106 opened this issue · 3 comments

I want to both save report to a file and send to client so I use that code inside an Action in my Controller
HttpContext.JsReportFeature().Recipe(Recipe.PhantomPdf).OnAfterRender((report) => { Stream content = report.Content; string path = @"test.pdf"; using (FileStream fs = System.IO.File.Create(path)) { content.CopyTo(fs); } });
However, it only save report to a file on server, not send the report content to Client.

You may have a look at this pull request:
https://github.com/JeanCollas/jsreport-dotnet-aspnetcore/blob/master/README.md
Which provides an alternative solution.