<?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[How use if else condition]]></title><description><![CDATA[<p>I'm trying to do the if else condition in document itself but it's not working properly give me some example for create if else condition. Is this possible without creating function.</p>
<p>In document I'm trying like this { IF &quot;{MREGEFIELD defect}&quot; = &quot;New&quot; &quot;YES&quot; &quot;NO&quot; } it print the value while generating pdf 'YES' only</p>
]]></description><link>https://forum.jsreport.net/topic/3327/how-use-if-else-condition</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 01:00:16 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/3327.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Oct 2024 02:48:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How use if else condition on Invalid Date]]></title><description><![CDATA[<p>I'm trying to do the if else condition in document itself but it's not working properly give me some example for create if else condition. Is this possible without creating function.</p>
<p>In document I'm trying like this { IF &quot;{MREGEFIELD defect}&quot; = &quot;New&quot; &quot;YES&quot; &quot;NO&quot; } it print the value while generating pdf 'YES' only</p>
]]></description><link>https://forum.jsreport.net/post/14129</link><guid isPermaLink="true">https://forum.jsreport.net/post/14129</guid><dc:creator><![CDATA[Karthikeyan19991211]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How use if else condition on Mon, 04 Nov 2024 12:50:03 GMT]]></title><description><![CDATA[<p>Are you using Handlebars?<br />
I'm not shure what {MREGEFIELD defect} means. Is <code>defect</code> a property of <code>MREGEFIELD</code>? I.e. <code>MREGEFIELD.defect</code>?</p>
<p>I don't think Handlebars has a comparison helper out of the box. <code>#if</code> can only check if a value is truthy.</p>
<p>I'm using the npm package &quot;handlebars-helpers&quot; which for example includes <code>#eq</code> for comparing values, like below. If your use case is a one-off it's probably easier to just write a function. Are you using JSReport Studio? In that case it's really simple to write a comparison helper function in the helper pane and call this function from Handlebars.</p>
<p>Here is how your comparison could look like with #eq.</p>
<pre><code>{{#eq MREGEFIELD.defect &quot;New&quot;}}
    Yes
{{else}}
    No
{{/eq}}
</code></pre>
]]></description><link>https://forum.jsreport.net/post/14172</link><guid isPermaLink="true">https://forum.jsreport.net/post/14172</guid><dc:creator><![CDATA[msageryd]]></dc:creator><pubDate>Mon, 04 Nov 2024 12:50:03 GMT</pubDate></item></channel></rss>