Unable to find specified template or user doesnt have permissions to read it



  • Hi,
    I'm trying to recreate this example - https://youtu.be/qqTGQgkEHow?t=404

    In my studio project, I see the templates created in the bin folder. But when I refer this project in another one and try to generate the report. I'm getting the below error.

    Error rendering report: instance has been daemonized and initialized successfully (pid: 33424)rendering has finished with errors:A critical error occurred while trying to execute the render command (2). Unable to find specified template or user doesnt have permissions to read it: Invoice (1). caused by error (2):-> stackError: at onCriticalError (D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commands\render.js:302:19) at D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commands\render.js:256:14 at processTicksAndRejections (internal/process/task_queues.js:97:5)caused by error (1):-> stackError: at Client.render (D:\snapshot\jsreport\node_modules\jsreport-client\lib\client.js) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async startRender (D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commands\render.js:319:24) at async D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commands\render.js:226:22 at async Commander.executeCommand (D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commander.js:242:22)Remote stack: Error: at D:\snapshot\jsreport\node_modules\jsreport-core\lib\util\createError.js:11:13 at Reporter.createError (D:\snapshot\jsreport\node_modules\jsreport-core\lib\reporter.js:332:12) at AsyncFunction.<anonymous> (D:\snapshot\jsreport\node_modules\jsreport-templates\lib\templates.js:134:20)

    I tired giving full permission as well. here's the code I use to generate the report

    var rs = new LocalReporting()
               .Configure(c => c.FileSystemStore())
               .UseBinary(JsReportBinary.GetBinary())
               .AsUtility()
               .Create();
    
            var report = await rs.RenderByNameAsync("Invoice", new
            {
    
                number = "123",
                seller = new
                {
                    name = "Next Step Webs, Inc.",
                    road = "12345 Sunny Road",
                    country = "Sunnyville, TX 12345"
                },
                buyer = new
                {
                    name = "Acme Corp.",
                    road = "16 Johnson Road",
                    country = "Paris, France 8060"
                },
                items = new[]
                    {
                        new { name = "Website design", price = 300 }
                    }
            });
    
            using (var fs = File.Create("test.pdf"))
            {
                report.Content.CopyTo(fs);
            }
    

    Am I missing anything? could you provide me the latest example?



  • I prepared an example here, please check it out
    https://github.com/jsreport/jsreport-dotnet-example-multiple-projects


Log in to reply
 

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