<?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[Best approach to accessing the data from a template]]></title><description><![CDATA[<p>I would like to do some maths, counts, and other interrogation of the data from either template or a js file.<br />
I am using the JSRender engine in all my reports the example below is using handlebars, when converting to JSRender it fails to work - most likely PEBCAK.</p>
<p>I found some examples on using scripts etc. the closest I have got was with this.<br />
<a href="https://playground.jsreport.net/w/anon/kntiAOBG" rel="nofollow">https://playground.jsreport.net/w/anon/kntiAOBG</a><br />
Which demonstrates one of my simple goals of making a count of the number of items in the JSON.</p>
<p><strong>My two questions are :</strong></p>
<ul>
<li>
<p>Whats the recommended approach?</p>
</li>
<li>
<p>How do you go about referencing the data file for the report?</p>
</li>
</ul>
]]></description><link>https://forum.jsreport.net/topic/672/best-approach-to-accessing-the-data-from-a-template</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 04:32:32 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/672.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 18 Aug 2018 15:37:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Best approach to accessing the data from a template on Sat, 18 Aug 2018 15:38:02 GMT]]></title><description><![CDATA[<p>I would like to do some maths, counts, and other interrogation of the data from either template or a js file.<br />
I am using the JSRender engine in all my reports the example below is using handlebars, when converting to JSRender it fails to work - most likely PEBCAK.</p>
<p>I found some examples on using scripts etc. the closest I have got was with this.<br />
<a href="https://playground.jsreport.net/w/anon/kntiAOBG" rel="nofollow">https://playground.jsreport.net/w/anon/kntiAOBG</a><br />
Which demonstrates one of my simple goals of making a count of the number of items in the JSON.</p>
<p><strong>My two questions are :</strong></p>
<ul>
<li>
<p>Whats the recommended approach?</p>
</li>
<li>
<p>How do you go about referencing the data file for the report?</p>
</li>
</ul>
]]></description><link>https://forum.jsreport.net/post/3332</link><guid isPermaLink="true">https://forum.jsreport.net/post/3332</guid><dc:creator><![CDATA[Carl Blanchard]]></dc:creator><pubDate>Sat, 18 Aug 2018 15:38:02 GMT</pubDate></item><item><title><![CDATA[Reply to Best approach to accessing the data from a template on Invalid Date]]></title><description><![CDATA[<p>Perhaps this is what you are looking for?<br />
<a href="https://jsreport.net/blog/using-input-data-in-html-page-inline-javascript" rel="nofollow">https://jsreport.net/blog/using-input-data-in-html-page-inline-javascript</a></p>
]]></description><link>https://forum.jsreport.net/post/3338</link><guid isPermaLink="true">https://forum.jsreport.net/post/3338</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Best approach to accessing the data from a template on Invalid Date]]></title><description><![CDATA[<p>Thanks for the reply. I've had a play with what you suggest but data seems to be nothing???</p>
<p>My goal is to have a data file for a report and in the template access that data directly.</p>
<p>From data file...</p>
<p>{<br />
&quot;Status&quot;: &quot;O&quot;,<br />
&quot;AssetAssessments&quot;: [<br />
{<br />
&quot;CountOfFindings&quot;: 1,<br />
&quot;EquipmentCompliesWithStandard&quot;: &quot;N/A&quot;,<br />
&quot;Findings&quot;: [<br />
{</p>
<p>In report template</p>
<p>{{:data.Findings.length}}</p>
<p>See what I mean ?</p>
]]></description><link>https://forum.jsreport.net/post/3371</link><guid isPermaLink="true">https://forum.jsreport.net/post/3371</guid><dc:creator><![CDATA[Carl Blanchard]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>