Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jsreport.aspnetcore is not working on iis server #8

Open
previewtech opened this issue Jan 16, 2021 · 2 comments
Open

Jsreport.aspnetcore is not working on iis server #8

previewtech opened this issue Jan 16, 2021 · 2 comments

Comments

@previewtech
Copy link

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.

@pofider
Copy link
Contributor

pofider commented Jan 17, 2021

Please elaborate more. What error are you getting?

@previewtech
Copy link
Author

previewtech commented Jan 18, 2021

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.

liyashereef pushed a commit to liyashereef/jsreport-dotnet-example-webapp that referenced this issue Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants