Yes removing the MiddlewareFilter fixed this issue. I just wanted to say thank you for producing such a great product!
SweetLekDude
@SweetLekDude
0
Reputation
2
Posts
1030
Profile views
0
Followers
0
Following
Posts made by SweetLekDude
-
RE: ASP.NET Core 2.0 Return stream
-
ASP.NET Core 2.0 Return stream
I have worked with the samples from the video and all are working fine. I now want to return a stream now....here's my code based on the way I think it should work. Unfortunately I get an exception. JsReportBinaryException: Error rendering report: rendering has finished with errors:
Here's my code in my Controller( I've taken my example from the video and it's a simple test instead of using File.Create I am returning a stream)[MiddlewareFilter(typeof(JsReportPipeline))] public async Task<IActionResult> ReportContentReturnAsync() { var rs = new LocalReporting().UseBinary(JsReportBinary.GetBinary()).AsUtility().Create(); var report = await rs.RenderAsync(new RenderRequest() { Template = new Template() { Recipe = Recipe.PhantomPdf, Engine = Engine.None, Content = "Hello from pdf" } }); var memoryStream = new MemoryStream(); await report.Content.CopyToAsync(memoryStream); memoryStream.Seek(0, SeekOrigin.Begin); return new FileStreamResult(memoryStream, "application/pdf") { FileDownloadName = "out.pdf" }; }