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.



  • I've created one template, namely "feedbackdetailpdf" in playground.jsreport.net, exported it and unzipped them inside jsreport\temp\data\feedbackdetailpdf

    Unfortunately, you can't just unzip the exported zip as it includes a special format only import can understand.
    I am not sure if you plan a workflow or if you are just fiddling...
    You should be still able to reach studio UI and import. Even when using "AsUtility" because it starts a background jsreport after the first render.
    Try to open in browser localhost:5488 and do the import.



  • 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.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.