<?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[Accessing request.data with for loop]]></title><description><![CDATA[<p>Hi,</p>
<p>I am testing jsreport with jsreportonline. I was able to make a REST Call to get the data from our webservice (Dreamfactory), but I am struggeling to access the data for the report.</p>
<p>Here is my beforeRender code:<br />
<img src="/uploads/files/1507531836785-request.png" alt="0_1507531836459_Request.png" class="img-responsive img-markdown" /></p>
<p>With request.template.content = request.data.rows; I get the following report:<br />
<img src="/uploads/files/1507531933615-report.png" alt="0_1507531933479_Report.png" class="img-responsive img-markdown" /></p>
<p>So far so good.</p>
<p>Now I want to use this data in the report. I followed the example of the deep dive video and switched to jsrender with a for loop:<br />
<img src="/uploads/files/1507532098084-reportdefinition.png" alt="0_1507532097941_Reportdefinition.png" class="img-responsive img-markdown" /></p>
<p>But the rendered report only shows the h1 title. No data is displayed by the for loop.</p>
<p>What am I doing wrong?</p>
<p>Thx for any help.</p>
<p>Reto E.</p>
]]></description><link>https://forum.jsreport.net/topic/269/accessing-request-data-with-for-loop</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Mar 2026 14:57:51 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/269.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 09 Oct 2017 06:58:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Accessing request.data with for loop on Invalid Date]]></title><description><![CDATA[<p>Hi,</p>
<p>I am testing jsreport with jsreportonline. I was able to make a REST Call to get the data from our webservice (Dreamfactory), but I am struggeling to access the data for the report.</p>
<p>Here is my beforeRender code:<br />
<img src="/uploads/files/1507531836785-request.png" alt="0_1507531836459_Request.png" class="img-responsive img-markdown" /></p>
<p>With request.template.content = request.data.rows; I get the following report:<br />
<img src="/uploads/files/1507531933615-report.png" alt="0_1507531933479_Report.png" class="img-responsive img-markdown" /></p>
<p>So far so good.</p>
<p>Now I want to use this data in the report. I followed the example of the deep dive video and switched to jsrender with a for loop:<br />
<img src="/uploads/files/1507532098084-reportdefinition.png" alt="0_1507532097941_Reportdefinition.png" class="img-responsive img-markdown" /></p>
<p>But the rendered report only shows the h1 title. No data is displayed by the for loop.</p>
<p>What am I doing wrong?</p>
<p>Thx for any help.</p>
<p>Reto E.</p>
]]></description><link>https://forum.jsreport.net/post/1239</link><guid isPermaLink="true">https://forum.jsreport.net/post/1239</guid><dc:creator><![CDATA[RetoE]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Accessing request.data with for loop on Invalid Date]]></title><description><![CDATA[<p>This is likely because the <code>body</code> in the response from your API is string. Not a JSON.<br />
You should add the <code>json: true</code> to the request parameter like:</p>
<pre><code class="language-js">require('request')({ url: '....', json: true, ... })
</code></pre>
<p>See the <a href="https://github.com/request/request#requestoptions-callback" rel="nofollow">request docs</a> for details.</p>
]]></description><link>https://forum.jsreport.net/post/1240</link><guid isPermaLink="true">https://forum.jsreport.net/post/1240</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Accessing request.data with for loop on Mon, 09 Oct 2017 08:15:11 GMT]]></title><description><![CDATA[<p>Thx.<br />
I added the json: true and had to remove the JSON.stringify from the request body.<br />
Now it works fine.</p>
]]></description><link>https://forum.jsreport.net/post/1241</link><guid isPermaLink="true">https://forum.jsreport.net/post/1241</guid><dc:creator><![CDATA[RetoE]]></dc:creator><pubDate>Mon, 09 Oct 2017 08:15:11 GMT</pubDate></item><item><title><![CDATA[Reply to Accessing request.data with for loop on Invalid Date]]></title><description><![CDATA[<p>Oh I forgot to mention that. Glad it works now.</p>
]]></description><link>https://forum.jsreport.net/post/1242</link><guid isPermaLink="true">https://forum.jsreport.net/post/1242</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>