<?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[Global Helper variable docker]]></title><description><![CDATA[<p>I am using jsreport with phantomjs and handlebar templating. I am running the project in Windows and on docker. While running it on docker, the zoom has to be adjusted because phantomjs has an issue. So I followed the steps here -&gt; <a href="https://forum.jsreport.net/topic/188/dpi-option-doesn-t-seems-to-work/7">https://forum.jsreport.net/topic/188/dpi-option-doesn-t-seems-to-work/7</a><br />
The solution given by <a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/4">@bjrmatos</a> to use zoom works. However, in his solution he says he created a variable to check the OS. I have a lot of templates and I dont want to put in every js file the same variable. I was hoping I could use global helpers.js, which is under asset and is shared helper attached to each template. But then when I declare a variable inside the global helpers.js file and try accessing it in the template, the variable is undefined. Can you please let me know what I could be missing.</p>
<p>So my global helpers.js looks like this -&gt;</p>
<pre><code>var os = require('os')
// variable unix is coming as undefined in all templates
const unix = os.platform == 'win32' ? false: true;

function toJSON(data) {
  return JSON.stringify(data);
}
</code></pre>
]]></description><link>https://forum.jsreport.net/topic/2952/global-helper-variable-docker</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Jul 2026 04:50:09 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/2952.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 09 Oct 2023 18:36:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Global Helper variable docker on Tue, 10 Oct 2023 20:18:58 GMT]]></title><description><![CDATA[<p>I am using jsreport with phantomjs and handlebar templating. I am running the project in Windows and on docker. While running it on docker, the zoom has to be adjusted because phantomjs has an issue. So I followed the steps here -&gt; <a href="https://forum.jsreport.net/topic/188/dpi-option-doesn-t-seems-to-work/7">https://forum.jsreport.net/topic/188/dpi-option-doesn-t-seems-to-work/7</a><br />
The solution given by <a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/4">@bjrmatos</a> to use zoom works. However, in his solution he says he created a variable to check the OS. I have a lot of templates and I dont want to put in every js file the same variable. I was hoping I could use global helpers.js, which is under asset and is shared helper attached to each template. But then when I declare a variable inside the global helpers.js file and try accessing it in the template, the variable is undefined. Can you please let me know what I could be missing.</p>
<p>So my global helpers.js looks like this -&gt;</p>
<pre><code>var os = require('os')
// variable unix is coming as undefined in all templates
const unix = os.platform == 'win32' ? false: true;

function toJSON(data) {
  return JSON.stringify(data);
}
</code></pre>
]]></description><link>https://forum.jsreport.net/post/12738</link><guid isPermaLink="true">https://forum.jsreport.net/post/12738</guid><dc:creator><![CDATA[Prashanth Ganju]]></dc:creator><pubDate>Tue, 10 Oct 2023 20:18:58 GMT</pubDate></item><item><title><![CDATA[Reply to Global Helper variable docker on Invalid Date]]></title><description><![CDATA[<p>You can get an idea here</p>
<p><a href="https://playground.jsreport.net/w/anon/6zp1nhY0" rel="nofollow">https://playground.jsreport.net/w/anon/6zp1nhY0</a></p>
<p>or even here<br />
<a href="https://playground.jsreport.net/w/anon/1F6UWRv5" rel="nofollow">https://playground.jsreport.net/w/anon/1F6UWRv5</a></p>
]]></description><link>https://forum.jsreport.net/post/12742</link><guid isPermaLink="true">https://forum.jsreport.net/post/12742</guid><dc:creator><![CDATA[admin]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>