I have one IActionMethod where I want download PDF and View PDF when I use [MiddlewareFilter(typeof(JsReportPipeline))]
on then view pdf success render and download is not work. when I remove filter [MiddlewareFilter(typeof(JsReportPipeline))]
then view is not working and downloading is working well. Please Give me any Suggestion.
Posts made by AllahDittaFalcon
-
RE: Can we customize enable and disable middleware filter?
-
Can we customize enable and disable middleware filter?
Can we customize enable and disable middleware filter [MiddlewareFilter(typeof(JsReportPipeline))] this filter on this method.
[MiddlewareFilter(typeof(JsReportPipeline))] public ActionResult Invoice() { HttpContext.JsReportFeature().Recipe(Recipe.ChromePdf); return View(InvoiceModel.Example()); }```
-
RE: how to download jsreport without open using c# in .Net
how get view bage Value in this method please help me.
and how pass to view.
https://github.com/jsreport/jsreport-dotnet-aspnetcore/blob/master/jsreport.AspNetCore/JsReportMVCService.cs#L52 -
RE: how to download jsreport without open using c# in .Net
hi... Now I want to known that How ViewBage value render on view with using
_jsReportMVCService. RenderViewAsync
Please suggest me any query. I stuck that point. I pass model object already to_jsReportMVCService. RenderViewAsync
but my ViewBage value did not render on view. -
RE: how to download jsreport without open using c# in .Net
Thanks for suggestion jan_blaha.
-
RE: how to download jsreport without open using c# in .Net
Hi...... Jan_Blaha thanks for suggestion.. I use _jsReportMVCService. RenderViewAsync as you recommended. But my css not work. My reginal invoice design is . But I get from _jsReportMVCService. RenderViewAsync is . How I resolve this issue?
-
RE: how to download jsreport without open using c# in .Net
Thanks for suggestions....
-
RE: how to download jsreport without open using c# in .Net
Hi... Thanks for suggestion. But whole scenario I want single zip file of multiple PDFs and that file download as zip automatically. Is Possible? Is Possible give me any suggestion.
-
RE: how to download jsreport without open using c# in .Net
I want create multiple PDFs and download automatically as zip with JsReport in ASP.NET CORE. Is Possible?
-
RE: how to download jsreport without open using c# in .Net
Can we create multiple PDF ?
-
how to download jsreport without open using c# in .Net
I am Use JS Report for view. This code render the file and and Save in root directory. But I want file is directly download not open for view.
var header = await _jsReportMVCService.RenderViewToStringAsync(HttpContext, RouteData, "Header", new { }); var footer = await _jsReportMVCService.RenderViewToStringAsync(HttpContext, RouteData, "Footer", new { }); HttpContext.JsReportFeature() .Recipe(Recipe.ChromePdf) .Configure((r) => { //r.Options = new RenderOptions //{ // Timeout = 600000 //}; r.Template.Chrome = new Chrome { HeaderTemplate = header, FooterTemplate = footer, DisplayHeaderFooter = true, MarginTop = "1cm", MarginLeft = "2cm", MarginBottom = "2cm", MarginRight = "1.5cm", Format = "A3" }; }); HttpContext.JsReportFeature().OnAfterRender((renderer) => { using (var file = System.IO.File.Open("EmployeesList.pdf", FileMode.Create)) { renderer.Content.CopyTo(file); } renderer.Content.Seek(0, SeekOrigin.Begin); });