Jsreport.aspnetcore is not working on iis server
Dear All,
We have implement the jsreport in asp.net core project to save pdf file in physical location. This is working on local setup very well but after publish when we upload the source file on server, jsreport feature is not work.
Startup Code: services.AddJsReport(new LocalReporting().UseBinary(JsReportBinary.GetBinary()).KillRunningJsReportProcesses().AsUtility().Create());
Controller Code:
string filepath = Path.Combine(env.WebRootPath, "Upload/license/Unsigned" + id + ".pdf"); HttpContext.JsReportFeature().Recipe(Recipe.ChromePdf) .Configure((r) => r.Template.Chrome = new Chrome { HeaderTemplate = "", DisplayHeaderFooter = true, MarginTop = ".5cm", MarginLeft = "0cm", MarginBottom = "2cm", MarginRight = "0cm" }) .OnAfterRender((r) => { using (var file = System.IO.File.Open(filepath, FileMode.Create)) { r.Content.CopyTo(file); } r.Content.Seek(0, SeekOrigin.Begin); });
return View("print_accepted_license", result);
Kindly provide help.
Please elaborate more. What error are you getting?
Dear @pofider, We are not getting any error. Program code executes properly without any error but when we open respective location on server to get pdf file then there is no file at location.