Skip to content

Jsreport.aspnetcore is not working on iis server #8

@previewtech

Description

@previewtech

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions