<?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[Dynamic height and weight in table]]></title><description><![CDATA[<p>Hello:</p>
<p>I am using JSReport in my project. I am very happy with the tool. Now I have an important issue with one template. I want to build a basic report similar to this (<a href="https://playground.jsreport.net/studio/workspace/rJftqRaQ/10" rel="nofollow">https://playground.jsreport.net/studio/workspace/rJftqRaQ/10</a>). But I want the table to be dynamic for the variables: height and weight. I don´t know how do this. Here is an example of how I would like the report to be (<a href="https://playground.jsreport.net/studio/workspace/BkyX5BZ3l/6" rel="nofollow">https://playground.jsreport.net/studio/workspace/BkyX5BZ3l/6</a>).</p>
]]></description><link>https://forum.jsreport.net/topic/28/dynamic-height-and-weight-in-table</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Mar 2026 15:51:54 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/28.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 23 Mar 2017 16:56:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dynamic height and weight in table on Invalid Date]]></title><description><![CDATA[<p>Hello:</p>
<p>I am using JSReport in my project. I am very happy with the tool. Now I have an important issue with one template. I want to build a basic report similar to this (<a href="https://playground.jsreport.net/studio/workspace/rJftqRaQ/10" rel="nofollow">https://playground.jsreport.net/studio/workspace/rJftqRaQ/10</a>). But I want the table to be dynamic for the variables: height and weight. I don´t know how do this. Here is an example of how I would like the report to be (<a href="https://playground.jsreport.net/studio/workspace/BkyX5BZ3l/6" rel="nofollow">https://playground.jsreport.net/studio/workspace/BkyX5BZ3l/6</a>).</p>
]]></description><link>https://forum.jsreport.net/post/71</link><guid isPermaLink="true">https://forum.jsreport.net/post/71</guid><dc:creator><![CDATA[dslt]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Invalid Date]]></title><description><![CDATA[<p>Hi,</p>
<p>this tutorial shows how to create dynamic range in excel template, maybe it helps?<br />
<a href="https://jsreport.net/learn/dynamic-excel-pivot-table" rel="nofollow">https://jsreport.net/learn/dynamic-excel-pivot-table</a></p>
]]></description><link>https://forum.jsreport.net/post/72</link><guid isPermaLink="true">https://forum.jsreport.net/post/72</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Mon, 27 Mar 2017 08:04:28 GMT]]></title><description><![CDATA[<p>Hello:</p>
<p>Thank you for your attention. I am going to try to explain my problema in more detail. I have this Project (<a href="https://playground.jsreport.net/studio/workspace/Hy_V2BSh/53" rel="nofollow">https://playground.jsreport.net/studio/workspace/Hy_V2BSh/53</a>). The only problem that I have is with Sheet5 of the XLSX template. I want the graph on Sheet5 to be fed by the data from Table5. By default the size of the graph in the template is A1:B2. However, I need that the size of the graph to adapt dynamically according to the size indicated by Table 5 (in this case A1:E4, in other cases other sizes). I do not know how to have the size of the graph change dynamically, could you explain to me how to make this happen?</p>
<p>Thank you very much.</p>
]]></description><link>https://forum.jsreport.net/post/87</link><guid isPermaLink="true">https://forum.jsreport.net/post/87</guid><dc:creator><![CDATA[dslt]]></dc:creator><pubDate>Mon, 27 Mar 2017 08:04:28 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Invalid Date]]></title><description><![CDATA[<p>I see. The solution for dynamic number of rows is to use offset excel function. This is described in the linked tutorial<br />
<a href="https://jsreport.net/learn/dynamic-excel-pivot-table" rel="nofollow">https://jsreport.net/learn/dynamic-excel-pivot-table</a></p>
<p>Unfortunately this doesn't seems to work for dynamic number of columns. A range defined like this should work at the first glance, but for some reason excel doesn't support it.</p>
<pre><code>=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A), COUNTA(Sheet1!$A2:$D2))
</code></pre>
<p>This means you need to dig down deep to the excel format and add chart series by hand using xlsx helper functions. Something like this</p>
<pre><code>{{#xlsxMerge &quot;xl/charts/chart1.xml&quot; &quot;['c:chartSpace']['c:chart'][0]['c:plotArea'][0]['c:barChart'][0]&quot;}}
&lt;c:ser&gt;
    &lt;c:ser&gt;
        &lt;c:idx val=&quot;0&quot;/&gt;
        &lt;c:order val=&quot;0&quot;/&gt;                                           
        &lt;c:cat&gt;
            &lt;c:numRef&gt;
                &lt;c:f&gt;Sheet1!$A$2:$A$5&lt;/c:f&gt;                          
            &lt;/c:numRef&gt;
        &lt;/c:cat&gt;
        &lt;c:val&gt;
            &lt;c:numRef&gt;
                &lt;c:f&gt;Sheet1!$B$2:$B$5&lt;/c:f&gt;                          
            &lt;/c:numRef&gt;
        &lt;/c:val&gt;
    &lt;/c:ser&gt;
&lt;/c:ser&gt;

</code></pre>
<p>I've prepared for you simple demo, which I hope will lead you to the desired results.</p>
<p><a href="https://playground.jsreport.net/studio/workspace/HyqJPOI3x/5" rel="nofollow">https://playground.jsreport.net/studio/workspace/HyqJPOI3x/5</a></p>
]]></description><link>https://forum.jsreport.net/post/88</link><guid isPermaLink="true">https://forum.jsreport.net/post/88</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Fri, 31 Mar 2017 06:20:27 GMT]]></title><description><![CDATA[<p>Hello:</p>
<p>Thank you very much jan_blaha. You are great!</p>
<p>One more question: working on your solution I encountered another problem- I am working with JSReport through its API. To resolve the bug you suggest (&quot;['c:chartSpace']['c:chart'][0]['c:plotArea'][0]['c:barChart'][0]&quot;) I need to add the &quot;hackMerge&quot; function to the figure in your example. I have tried to add this function in:</p>
<ul>
<li>Attribute &quot;helpers&quot; of the API call.</li>
<li>Implement in script file and declare its &quot;shortid&quot; in attribute &quot;shortid&quot; of the object&quot; &quot;script&quot; of the API call</li>
</ul>
<p>In all cases I receive a similar error (with xlsxMerge):</p>
<pre><code>......mplate[fileName]); } xlsxMerge.call(this, fileName, 'hack()', opts) }.......
</code></pre>
<p>SyntaxError: Unexpected identifier</p>
<p>Could you explain to me how to solve this problem?</p>
]]></description><link>https://forum.jsreport.net/post/100</link><guid isPermaLink="true">https://forum.jsreport.net/post/100</guid><dc:creator><![CDATA[dslt]]></dc:creator><pubDate>Fri, 31 Mar 2017 06:20:27 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Invalid Date]]></title><description><![CDATA[<p>You don't want to store the template in jsreport, but rather send the template content, helpers and data in the API call?</p>
]]></description><link>https://forum.jsreport.net/post/101</link><guid isPermaLink="true">https://forum.jsreport.net/post/101</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Fri, 31 Mar 2017 06:21:41 GMT]]></title><description><![CDATA[<p>Hello:</p>
<p>No. I store the templates in JSReport, but I don´t store the template content, or the data (I use API call) This configuration works fine in my project. The problem is: I don´t know how to add the &quot;hackMerge&quot; function in the API call. I have tried the last solution and it results in error. How can I solve this problem?</p>
<p>Example to the API call:</p>
<pre><code>{
   template: {
     content: dataContent,
     recipe: 'xlsx',
     engine: &quot;handlebars&quot;,
     phantom: optionsPhantom,
     xlsxTemplate: {
        shortid: idXLSXTemplate
     }
   },
   data : dataReport
}
</code></pre>
]]></description><link>https://forum.jsreport.net/post/102</link><guid isPermaLink="true">https://forum.jsreport.net/post/102</guid><dc:creator><![CDATA[dslt]]></dc:creator><pubDate>Fri, 31 Mar 2017 06:21:41 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Invalid Date]]></title><description><![CDATA[<p>The helpers are stored in the <code>template.helpers</code> property, so you need to send it there, if you don't store it in the template. This body works</p>
<pre><code>{ &quot;template&quot;: { &quot;name&quot;: &quot;xlsxtest&quot;, &quot;helpers&quot;: &quot;function hackMerge(fileName, path, opts) {\n    \/\/ workaround for this bug\n    \/\/ https:\/\/github.com\/jsreport\/jsreport-xlsx\/issues\/20\n    opts.data.root.$xlsxTemplate[fileName].hack = function () {\n        return new Function('obj', 'return obj' + path)(opts.data.root.$xlsxTemplate[fileName]);\n    }\n    \n    xlsxMerge.call(this, fileName, 'hack()', opts)\n}&quot;, &quot;content&quot;: &quot;{{#hackMerge \&quot;xl\/workbook.xml\&quot; \&quot;.workbook.sheets[0].sheet[0]\&quot;}}\n   &lt;sheet name=\&quot;My Sheet Name\&quot;\/&gt;\n{{\/hackMerge}}{{{xlsxPrint}}}&quot; } }
</code></pre>
]]></description><link>https://forum.jsreport.net/post/103</link><guid isPermaLink="true">https://forum.jsreport.net/post/103</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Fri, 31 Mar 2017 06:23:20 GMT]]></title><description><![CDATA[<p>I tried your solution:</p>
<pre><code>{
  template: {
  content: dataContent,
  recipe: 'xlsx',
  engine: &quot;handlebars&quot;,
  phantom: optionsPhantom,
  xlsxTemplate: {
     shortid: idXLSXTemplate
  },
  &quot;helpers&quot;: &quot;function hackMerge(fileName, path, opts) {\n    \/\/ workaround for this bug\n    \/\/ https:\/\/github.com\/jsreport\/jsreport-xlsx\/issues\/20\n    opts.data.root.$xlsxTemplate[fileName].hack = function () {\n        return new Function('obj', 'return obj' + path)(opts.data.root.$xlsxTemplate[fileName]);\n    }\n    \n    xlsxMerge.call(this, fileName, 'hack()', opts)\n}&quot;
  },
  data : dataReport
}
</code></pre>
<p>And I get this error:</p>
<p>Error during rendering report:</p>
<pre><code>Unexpected identifier evalmachine.&lt;anonymous&gt;:409
function hackMerge(fileName, path, opts) { opts.data.root.$xlsxTemplate[fileName].hack = function () { return new Function('obj', 'return obj' + path)(opts.data.root.$xlsxTemplate[fileName]); } xlsxMerge.call(this, fileName, 'hack()', opts) }
                                                                                                                                                                                                  ^^^^^^^^^
SyntaxError: Unexpected identifier

xlsXmerge it´s not declared
</code></pre>
]]></description><link>https://forum.jsreport.net/post/104</link><guid isPermaLink="true">https://forum.jsreport.net/post/104</guid><dc:creator><![CDATA[dslt]]></dc:creator><pubDate>Fri, 31 Mar 2017 06:23:20 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Tue, 28 Mar 2017 14:16:15 GMT]]></title><description><![CDATA[<p>Did you alter the default jsreport server configuration? What you have in <code>tasks.strategy</code> ?</p>
]]></description><link>https://forum.jsreport.net/post/107</link><guid isPermaLink="true">https://forum.jsreport.net/post/107</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Tue, 28 Mar 2017 14:16:15 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Tue, 28 Mar 2017 14:55:13 GMT]]></title><description><![CDATA[<p>I have not altered the default jsreport server configuration and my tasks.strategy file is empty.</p>
]]></description><link>https://forum.jsreport.net/post/108</link><guid isPermaLink="true">https://forum.jsreport.net/post/108</guid><dc:creator><![CDATA[dslt]]></dc:creator><pubDate>Tue, 28 Mar 2017 14:55:13 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Invalid Date]]></title><description><![CDATA[<p>Hm, it works for me...<br />
Can you run like this other helpers, for example in html recipe?<br />
What jsreport version you have?<br />
Do you send the json correctly escaped?<br />
Maybe you could add a <code>console.log(request.template.helpers)</code> here to see if jsreport gets what you expect <a href="https://github.com/jsreport/jsreport-templates/blob/master/lib/templates.js#L76" rel="nofollow">https://github.com/jsreport/jsreport-templates/blob/master/lib/templates.js#L76</a></p>
]]></description><link>https://forum.jsreport.net/post/109</link><guid isPermaLink="true">https://forum.jsreport.net/post/109</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Invalid Date]]></title><description><![CDATA[<p>btw the latest release of jsreport includes fix for complex paths in xlsx helpers. So you can use standard xlsxMerge there.</p>
]]></description><link>https://forum.jsreport.net/post/126</link><guid isPermaLink="true">https://forum.jsreport.net/post/126</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Thu, 30 Mar 2017 17:01:56 GMT]]></title><description><![CDATA[<p>Hello:</p>
<p>Thank you very much for your help.</p>
<p>I solved the error, it was silly. Attribute &quot;helpers&quot; in the API call work correctly. The error was in the string content of the attribute &quot;helpers.&quot; You and I put:</p>
<pre><code>&quot;function hackMerge(fileName, path, opts) { opts.data.root.$xlsxTemplate[fileName].hack = function () { return new Function('obj', 'return obj' + path)(opts.data.root.$xlsxTemplate[fileName]); } xlsxMerge.call(this, fileName, 'hack()', opts) }&quot;
</code></pre>
<p>And the correct way is:</p>
<pre><code>&quot;function hackMerge(fileName, path, opts) { opts.data.root.$xlsxTemplate[fileName].hack = function () { return new Function('obj', 'return obj' + path)(opts.data.root.$xlsxTemplate[fileName]); };  xlsxMerge.call(this, fileName, 'hack()', opts) }&quot; 
</code></pre>
<p>With special attention to semicolon (&quot;;&quot;) before the if-else statement.</p>
<p>I have worked very hard creating tables in JSReport. I have created an adapted example for anyone who has the same needs as I did. The example is this (<a href="https://playground.jsreport.net/studio/workspace/HyqJPOI3x/21" rel="nofollow">https://playground.jsreport.net/studio/workspace/HyqJPOI3x/21</a>).</p>
]]></description><link>https://forum.jsreport.net/post/142</link><guid isPermaLink="true">https://forum.jsreport.net/post/142</guid><dc:creator><![CDATA[dslt]]></dc:creator><pubDate>Thu, 30 Mar 2017 17:01:56 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Invalid Date]]></title><description><![CDATA[<p>Ah, I can imagine this was easy to overlook. Glad you found it in the end.</p>
<p>Btw here you can find how to do code highlights for your next posts<br />
<a href="https://help.github.com/articles/creating-and-highlighting-code-blocks/" rel="nofollow">https://help.github.com/articles/creating-and-highlighting-code-blocks/</a></p>
]]></description><link>https://forum.jsreport.net/post/143</link><guid isPermaLink="true">https://forum.jsreport.net/post/143</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Invalid Date]]></title><description><![CDATA[<p>Code highlighted ;-)</p>
]]></description><link>https://forum.jsreport.net/post/144</link><guid isPermaLink="true">https://forum.jsreport.net/post/144</guid><dc:creator><![CDATA[dslt]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Invalid Date]]></title><description><![CDATA[<p>Hello:</p>
<p>One question more. Now, I want do a report with bars and lines in the graph. I am triying this (<a href="https://playground.jsreport.net/studio/workspace/HyqJPOI3x/23" rel="nofollow">https://playground.jsreport.net/studio/workspace/HyqJPOI3x/23</a>). Any ideas?</p>
]]></description><link>https://forum.jsreport.net/post/164</link><guid isPermaLink="true">https://forum.jsreport.net/post/164</guid><dc:creator><![CDATA[dslt]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Dynamic height and weight in table on Invalid Date]]></title><description><![CDATA[<p>Try to click <code>Download</code> in the <code>Run</code> context and open it in the excel. It will fix the xml and gives you protocol where you find what was wrong.</p>
]]></description><link>https://forum.jsreport.net/post/166</link><guid isPermaLink="true">https://forum.jsreport.net/post/166</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>