<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[.net7&#x2F;c# sdk: Script Parameter not recognized by jsreport server. Bug?]]></title><description><![CDATA[<p>Hello,</p>
<p>I am trying to duplicate this sample for ToC in .net 7 with the latest libraries.<br />
<a href="https://playground.jsreport.net/w/admin/tV6sVKbV" rel="nofollow">https://playground.jsreport.net/w/admin/tV6sVKbV</a></p>
<pre><code class="language-js">var scriptList = new List&lt;Script&gt;();
scriptList.Add(new Script()
{
     Content = @&quot;const jsreport = require('jsreport-proxy') .... --- all content of script from sample ----&quot;
});

HttpContext.JsReportFeature()
    .Recipe(Recipe.ChromePdf)
    .Engine(Engine.Handlebars)
    .Configure((r) =&gt;
        {
            r.Template.Scripts = scriptList;
            r.Template.Helpers = @&quot;
                const jsreport = require('jsreport-proxy')
                const headings = []
------ all content for the helpers -------- --&gt; copied from sample.&quot;
});
return View(&quot;Toc&quot;) // Template from playground
</code></pre>
<p>The error message I get is from node:<br />
JsReportBinaryException: Error rendering report: rendering has finished with errors:An error ocurred while trying to execute &quot;render&quot; command (3)(because) a critical error occurred while trying to execute the render command (2)(because) error when evaluating custom script anonymousTemplate must contains _id, name, shortid or content attribute (1)-- error (1) ---&gt; stackError: Error when evaluating custom script anonymousTemplate must contains _id, name, shortid or content attribute at Client.render (C:\snapshot\jsreport\packages\nodejs-client\lib\client.js:92:17) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async startRender (C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:321:24) at async C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:228:22 at async executeCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\executeCommand.js:22:20) at async Object.handler (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\registerCommand.js:76:9) at async parseCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:156:3) at async startCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:121:20) at async startCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:67:5) at async startProcessing (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startProcessing.js:195:3)Remote stack: Error: Template must contains _id, name, shortid or content attribute at C:\snapshot\jsreport\packages\jsreport-core\lib\shared\createError.js:10:13 at WorkerReporter.createError (C:\snapshot\jsreport\packages\jsreport-core\lib\shared\reporter.js:49:12) at AsyncFunction.&lt;anonymous&gt; (C:\snapshot\jsreport\packages\jsreport-core\lib\worker\templates.js:14:24) at ListenerCollection.fire (C:\snapshot\jsreport\packages\jsreport-core\lib\shared\listenerCollection.js:157:32) at async beforeRender (C:\snapshot\jsreport\packages\jsreport-core\lib\worker\render\render.js:25:5) at async WorkerReporter._render (C:\snapshot\jsreport\packages\jsreport-core\lib\worker\render\render.js:146:7) at async Object.proxy.render (C:\snapshot\jsreport\packages\jsreport-core\lib\worker\defaultProxyExtend.js:6:17)wrapped by:-- error (2) ---&gt; stackError: at onCriticalError (C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:304:19) at C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:258:14 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async executeCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\executeCommand.js:22:20) at async Object.handler (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\registerCommand.js:76:9) at async parseCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:156:3) at async startCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:121:20) at async startCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:67:5) at async startProcessing (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startProcessing.js:195:3)wrapped by:-- error (3) ---&gt; stackError: at startCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:127:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async startCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:67:5) at async startProcessing (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startProcessing.js:195:3)</p>
<p>Without the script section being set, I get the ToC as expected, but of course Page Numbers are missing (NA is written instead). Anybody has experienced the same? No help if I explicitly set the short id of the Script.</p>
<p>Maybe it's a bug in the Wrapper and the Script Object is not parsed correctly before being passed to the Node.js server?</p>
]]></description><link>https://forum.jsreport.net/topic/2722/net7-c-sdk-script-parameter-not-recognized-by-jsreport-server-bug</link><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 04:40:31 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/2722.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Mar 2023 16:53:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to .net7&#x2F;c# sdk: Script Parameter not recognized by jsreport server. Bug? on Invalid Date]]></title><description><![CDATA[<p>Hello,</p>
<p>I am trying to duplicate this sample for ToC in .net 7 with the latest libraries.<br />
<a href="https://playground.jsreport.net/w/admin/tV6sVKbV" rel="nofollow">https://playground.jsreport.net/w/admin/tV6sVKbV</a></p>
<pre><code class="language-js">var scriptList = new List&lt;Script&gt;();
scriptList.Add(new Script()
{
     Content = @&quot;const jsreport = require('jsreport-proxy') .... --- all content of script from sample ----&quot;
});

HttpContext.JsReportFeature()
    .Recipe(Recipe.ChromePdf)
    .Engine(Engine.Handlebars)
    .Configure((r) =&gt;
        {
            r.Template.Scripts = scriptList;
            r.Template.Helpers = @&quot;
                const jsreport = require('jsreport-proxy')
                const headings = []
------ all content for the helpers -------- --&gt; copied from sample.&quot;
});
return View(&quot;Toc&quot;) // Template from playground
</code></pre>
<p>The error message I get is from node:<br />
JsReportBinaryException: Error rendering report: rendering has finished with errors:An error ocurred while trying to execute &quot;render&quot; command (3)(because) a critical error occurred while trying to execute the render command (2)(because) error when evaluating custom script anonymousTemplate must contains _id, name, shortid or content attribute (1)-- error (1) ---&gt; stackError: Error when evaluating custom script anonymousTemplate must contains _id, name, shortid or content attribute at Client.render (C:\snapshot\jsreport\packages\nodejs-client\lib\client.js:92:17) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async startRender (C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:321:24) at async C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:228:22 at async executeCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\executeCommand.js:22:20) at async Object.handler (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\registerCommand.js:76:9) at async parseCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:156:3) at async startCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:121:20) at async startCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:67:5) at async startProcessing (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startProcessing.js:195:3)Remote stack: Error: Template must contains _id, name, shortid or content attribute at C:\snapshot\jsreport\packages\jsreport-core\lib\shared\createError.js:10:13 at WorkerReporter.createError (C:\snapshot\jsreport\packages\jsreport-core\lib\shared\reporter.js:49:12) at AsyncFunction.&lt;anonymous&gt; (C:\snapshot\jsreport\packages\jsreport-core\lib\worker\templates.js:14:24) at ListenerCollection.fire (C:\snapshot\jsreport\packages\jsreport-core\lib\shared\listenerCollection.js:157:32) at async beforeRender (C:\snapshot\jsreport\packages\jsreport-core\lib\worker\render\render.js:25:5) at async WorkerReporter._render (C:\snapshot\jsreport\packages\jsreport-core\lib\worker\render\render.js:146:7) at async Object.proxy.render (C:\snapshot\jsreport\packages\jsreport-core\lib\worker\defaultProxyExtend.js:6:17)wrapped by:-- error (2) ---&gt; stackError: at onCriticalError (C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:304:19) at C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:258:14 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async executeCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\executeCommand.js:22:20) at async Object.handler (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\registerCommand.js:76:9) at async parseCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:156:3) at async startCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:121:20) at async startCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:67:5) at async startProcessing (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startProcessing.js:195:3)wrapped by:-- error (3) ---&gt; stackError: at startCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:127:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async startCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:67:5) at async startProcessing (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startProcessing.js:195:3)</p>
<p>Without the script section being set, I get the ToC as expected, but of course Page Numbers are missing (NA is written instead). Anybody has experienced the same? No help if I explicitly set the short id of the Script.</p>
<p>Maybe it's a bug in the Wrapper and the Script Object is not parsed correctly before being passed to the Node.js server?</p>
]]></description><link>https://forum.jsreport.net/post/11784</link><guid isPermaLink="true">https://forum.jsreport.net/post/11784</guid><dc:creator><![CDATA[agyss]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to .net7&#x2F;c# sdk: Script Parameter not recognized by jsreport server. Bug? on Sat, 04 Mar 2023 10:25:04 GMT]]></title><description><![CDATA[<p>The example in playground defines the template for second render using the stored template name</p>
<pre><code>const finalR = await jsreport.render({
        template: {
            name: req.template.name
        },
        data: {
            ...req.data,
            $pdf: p,
            secondRender: true
        }
    })
</code></pre>
<p>This won't work in your case, because you don't persist templates. What you need to do is change the script to pass all template props to the second render.</p>
<pre><code>const finalR = await jsreport.render({
        template: {
            ...req.template
        },
        data: {
            ...req.data,
            $pdf: p,
            secondRender: true
        }
    })
</code></pre>
<p><a href="https://playground.jsreport.net/w/anon/ipv~_FZV" rel="nofollow">https://playground.jsreport.net/w/anon/ipv~_FZV</a></p>
]]></description><link>https://forum.jsreport.net/post/11789</link><guid isPermaLink="true">https://forum.jsreport.net/post/11789</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Sat, 04 Mar 2023 10:25:04 GMT</pubDate></item></channel></rss>