Thanks for the explanation. I was trying to implement this in a small project. Thought I can do it without creating a new project to host the web server part. Anyways thanks for the help.
fcshowe
@fcshowe
Posts made by fcshowe
-
RE: LocalReporting Unable to find exported templates from playground.jsreport.ne
-
LocalReporting Unable to find exported templates from playground.jsreport.ne
Hi,
I'm trying to run the reporter from net Core 3.1 controller:var reporter = new LocalReporting() .KillRunningJsReportProcesses() .UseBinary(JsReportBinary.GetBinary()) .RunInDirectory(Path.Combine(Directory.GetCurrentDirectory(),"jsreport", "temp")) .Configure(cfg => cfg.AllowedLocalFilesAccess().FileSystemStore().BaseUrlAsWorkingDirectory()) .AsUtility() .Create();
with the following json settings inside jsreport\temp:
{ "store": { "provider": "fs" }, "extensions": { "fs-store": { "dataDirectory": "data" } } }
I've created one template, namely "feedbackdetailpdf" in playground.jsreport.net, exported it and unzipped them inside jsreport\temp\data\feedbackdetailpdf
I've noticed that jsreport is able to get the dataDirectory from the above json. But it failed to generate the template.
render variable as below:
var report = await reporter.RenderByNameAsync("feedbackdetailpdf", new { title = "Detail Report", header = new { location_name = "Location Name", rating = "Rating", date_time = "Date & Time", feedbacks = "Feedbacks" }, content = dataTable, });
I'm getting error:
Error: Unable to find specified template or user doesnt have permissions to read it: feedbackdetailpdf\\n at D:\\\\snapshot\\\\jsreport\\\\node_modules\\\\jsreport-core\\\\lib\\\\util\\\\createError.js:11:13\\n at Reporter.createError (D:\\\\snapshot\\\\jsreport\\\\node_modules\\\\jsreport-core\\\\lib\\\\reporter.js:328:12)\\n at AsyncFunction.<anonymous> (D:\\\\snapshot\\\\jsreport\\\\node_modules\\\\jsreport-templates\\\\lib\\\\templates.js:134:20)\"}}]","creationDate":{"$$date":1589356555612},"modificationDate":{"$$date":1589361373502},"shortid":"2kfb0t6","_id":"ZeCy95X6j4Fu1KuC","$entitySet":"settings"}
I've given permission to "IIS_IUSRS" and make sure that the directories and its sub-directories have access to them. But for some reason it still fails to generate the report with the above logs.
Your help is greatly appreciated. Thanks.