Save report to a File
hieutran106 opened this issue · 3 comments
hieutran106 commented
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.
KhalilMohammad commented
JeanCollas commented
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.
pofider commented
This is now part of the docs
https://jsreport.net/learn/dotnet-aspnetcore#save-to-file