-
Notifications
You must be signed in to change notification settings - Fork 22
Description
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.