<?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[reportName not working. Reports are stored with random name.]]></title><description><![CDATA[<p>Hi, I was testing the jsreport with node.js and express. I am able to render a report as expected. I have mentioned the reportName in the options of jsreport.render() but still reports are stored with random name.</p>
<p>jsreport.render({<br />
template: { name:'driver-manifest-main'},<br />
data: req.body,<br />
&quot;options&quot;: {<br />
&quot;reportName&quot;: req.body.docId,<br />
&quot;reports&quot;: { &quot;save&quot;: true }<br />
}<br />
}).then((resp) =&gt; {<br />
<a href="http://logger.info" rel="nofollow">logger.info</a>('Processed the driver manifest generation request');<br />
res.send({&quot;msg&quot;:&quot;successful&quot;})<br />
}).catch((e) =&gt; {<br />
logger.error('Error occurred while processing driver manifest generation request ' + e.toString());<br />
res.send({<br />
&quot;statusCode&quot;: 500,<br />
&quot;errorMessage&quot;: e.toString(),<br />
&quot;timestamp&quot;: Date.now()<br />
})<br />
});</p>
]]></description><link>https://forum.jsreport.net/topic/1335/reportname-not-working-reports-are-stored-with-random-name</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 11:44:00 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/1335.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 08 Nov 2019 11:23:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to reportName not working. Reports are stored with random name. on Invalid Date]]></title><description><![CDATA[<p>Hi, I was testing the jsreport with node.js and express. I am able to render a report as expected. I have mentioned the reportName in the options of jsreport.render() but still reports are stored with random name.</p>
<p>jsreport.render({<br />
template: { name:'driver-manifest-main'},<br />
data: req.body,<br />
&quot;options&quot;: {<br />
&quot;reportName&quot;: req.body.docId,<br />
&quot;reports&quot;: { &quot;save&quot;: true }<br />
}<br />
}).then((resp) =&gt; {<br />
<a href="http://logger.info" rel="nofollow">logger.info</a>('Processed the driver manifest generation request');<br />
res.send({&quot;msg&quot;:&quot;successful&quot;})<br />
}).catch((e) =&gt; {<br />
logger.error('Error occurred while processing driver manifest generation request ' + e.toString());<br />
res.send({<br />
&quot;statusCode&quot;: 500,<br />
&quot;errorMessage&quot;: e.toString(),<br />
&quot;timestamp&quot;: Date.now()<br />
})<br />
});</p>
]]></description><link>https://forum.jsreport.net/post/6180</link><guid isPermaLink="true">https://forum.jsreport.net/post/6180</guid><dc:creator><![CDATA[Sahil333]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to reportName not working. Reports are stored with random name. on Invalid Date]]></title><description><![CDATA[<p>I apologize, this is a bit misleading in the docs.</p>
<p>The name of the stored file/blob is by default inherited from the entity unique _id. This can be customized using  <code>{ &quot;options&quot;: { &quot;reports&quot;: { &quot;save&quot;: true, &quot;blobName&quot;: &quot;myfilename&quot; } }</code></p>
<p>So your request should look like this</p>
<pre><code class="language-js">{
  &quot;template&quot;: { &quot;name&quot;:'driver-manifest-main'},
  &quot;data&quot;: req.body,
  &quot;options&quot;: {
    &quot;reports&quot;: { &quot;save&quot;: true, &quot;blobName&quot;: req.body.docId }
  }
}
</code></pre>
]]></description><link>https://forum.jsreport.net/post/6184</link><guid isPermaLink="true">https://forum.jsreport.net/post/6184</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to reportName not working. Reports are stored with random name. on Invalid Date]]></title><description><![CDATA[<p>oh great, thanks for the help :D</p>
]]></description><link>https://forum.jsreport.net/post/6186</link><guid isPermaLink="true">https://forum.jsreport.net/post/6186</guid><dc:creator><![CDATA[Sahil333]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to reportName not working. Reports are stored with random name. on Invalid Date]]></title><description><![CDATA[<p>How can I mention the directory where to store the generated reports?</p>
]]></description><link>https://forum.jsreport.net/post/6187</link><guid isPermaLink="true">https://forum.jsreport.net/post/6187</guid><dc:creator><![CDATA[Sahil333]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to reportName not working. Reports are stored with random name. on Invalid Date]]></title><description><![CDATA[<p>This can be only done globally. Using this config</p>
<pre><code class="language-js">&quot;blobStorage&quot;: {
	&quot;provider&quot;: &quot;fs&quot;,
	&quot;dataDirectory&quot;: &quot;myblobslocation&quot;
}
</code></pre>
]]></description><link>https://forum.jsreport.net/post/6188</link><guid isPermaLink="true">https://forum.jsreport.net/post/6188</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to reportName not working. Reports are stored with random name. on Invalid Date]]></title><description><![CDATA[<p>In the global config, I can mention the root folder and that's great. But my requirement is slightly different, I want to store the reports in different folders based on each request. So, I may want to store all the pdf reports of one day into a folder with that date. I want the same behavior for the azure blob storage.</p>
]]></description><link>https://forum.jsreport.net/post/6189</link><guid isPermaLink="true">https://forum.jsreport.net/post/6189</guid><dc:creator><![CDATA[Sahil333]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to reportName not working. Reports are stored with random name. on Invalid Date]]></title><description><![CDATA[<p>Ok. In that case, you can pass the path as part of the blob name.</p>
<pre><code class="language-js">{
    &quot;template&quot;: { &quot;name&quot;: &quot;a&quot; },
    &quot;options&quot;: { &quot;reports&quot;: { &quot;save&quot;: true, &quot;blobName&quot;: &quot;adirectory/foo&quot; } }
}
</code></pre>
<p>You just need to make sure that the directory exists. Probably using the <code>beforeRender</code> hook.<br />
You may also dynamically assemble the path there.<br />
<a href="https://jsreport.net/learn/scripts" rel="nofollow">https://jsreport.net/learn/scripts</a></p>
<pre><code class="language-js">const fs = require('fs')

function beforeRender(req, res) {
  const date = new Date().toISOString().substring(0, 10)
  req.options.reports.blobName = date + '/' + req.template.name
  fs.mkdirSync('data/storage/' + date)
}
</code></pre>
]]></description><link>https://forum.jsreport.net/post/6190</link><guid isPermaLink="true">https://forum.jsreport.net/post/6190</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to reportName not working. Reports are stored with random name. on Invalid Date]]></title><description><![CDATA[<p>Great. Thanks for the help :D</p>
]]></description><link>https://forum.jsreport.net/post/6191</link><guid isPermaLink="true">https://forum.jsreport.net/post/6191</guid><dc:creator><![CDATA[Sahil333]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>