<?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[Large aggregate reports crash chrome-pdf: chunk + parallel render + merge works for flat lists but breaks group subtotals and grand totals. What&#x27;s the recommended pattern?]]></title><description><![CDATA[<p>Hi jsreport team,</p>
<p>We use jsreport to render operational reports for a records-management system, and large<br />
reports regularly crash or time out. We built a chunk-and-parallelize workaround that works<br />
well for flat list reports, but it doesn't work for <strong>aggregate</strong> reports (grouped reports with<br />
subtotals, summary/statistics reports, cross-tabs). Those still go to jsreport as a single<br />
huge render and fail. We'd like to know the recommended architecture for this case.</p>
<h3>Environment</h3>
<ul>
<li>
<p>jsreport <strong>4.11.0</strong>, Node.js [version], Windows Server [version], hosted under <strong>IIS / iisnode</strong></p>
</li>
<li>
<p>Server: 8 GB RAM, 2 CPU cores</p>
</li>
<li>
<p>Client: .NET 10 API using the <code>jsreport.Client</code> NuGet package</p>
</li>
<li>
<p>Recipe: <code>chrome-pdf</code>, engine: <code>handlebars</code> (plus <code>pdfOperations</code> merge of a header template)</p>
</li>
<li>
<p>Config (relevant part):</p>
<p>{<br />
&quot;templatingEngines&quot;: { &quot;timeout&quot;: 1200000 },<br />
&quot;chrome&quot;: { &quot;timeout&quot;: 1200000 },<br />
&quot;reportTimeout&quot;: 1200000,<br />
&quot;workers&quot;: { &quot;numberOfWorkers&quot;: 6 },<br />
&quot;extensions&quot;: {<br />
&quot;scripts&quot;: { &quot;timeout&quot;: 1200000 },<br />
&quot;express&quot;: { &quot;inputRequestLimit&quot;: &quot;200mb&quot;, &quot;renderTimeout&quot;: 1200000 }<br />
}<br />
}</p>
</li>
</ul>
<h3>What fails</h3>
<ul>
<li>Typical failing report: ~10k+ rows, ~1000 pages expected</li>
<li>Playground reproduction with synthetic data: <a href="https://playground.jsreport.net/w/mdesaiATIMS/HgoUfkTW" rel="nofollow">https://playground.jsreport.net/w/mdesaiATIMS/HgoUfkTW</a></li>
<li>It did not let me save the full data with 35k rows that crashed the container in production environment. <img src="/uploads/files/1792018700922-upload-f86ed4a7-c18a-42be-ba36-5750e046a0ec-resized.png" alt="0_1792018695113_upload-f86ed4a7-c18a-42be-ba36-5750e046a0ec" class="img-responsive img-markdown" /></li>
</ul>
<h3>Our current workaround (works for flat lists)</h3>
<p>A SQL stored procedure returns the whole dataset as a JSON array. The .NET API then:</p>
<ol>
<li>Splits the array into chunks of <code>rowsPerPage * pagesPerChunk</code> rows</li>
<li>Sends every chunk to jsreport <strong>in parallel</strong> as separate render requests</li>
<li>Adds paging metadata to each chunk so the template knows where it is:</li>
<li>Merges the returned PDFs in .NET (PdfSharp) and stamps &quot;Page X of Y&quot; after the merge</li>
</ol>
<p>This is fast and stable for flat roster or list reports.</p>
<h3>Why it doesn't work for aggregate reports</h3>
<ul>
<li><strong>Group boundaries:</strong> chunks are cut by row count, so one group can be split across two chunks.<br />
The group header repeats and each half prints its own partial subtotal.</li>
<li><strong>Aggregates are per chunk:</strong> subtotals, counts and sums that are computed in Handlebars<br />
helpers or in the template only see their own chunk's rows. <code>{{Data.length}}</code>-style totals<br />
repeat in every chunk. This matches what was described in topic 1451 (&quot;Report generation<br />
takes too much time&quot;), which ended without a solution.</li>
<li><strong>Summary/statistics reports</strong> (counts by category x category, percentages of total) need<br />
the full dataset to produce even one page, so we can't split them at all. They go as one<br />
request with the whole JSON, and that is the request that crashes.</li>
</ul>
<h3>Questions</h3>
<ol>
<li>What is the recommended way to render large <strong>grouped / summary / aggregate</strong> reports in<br />
jsreport 4.x when the full dataset is too big for a single render, but the aggregates need<br />
all of the data?</li>
<li>When a report is split into multiple renders and then merged, how should <strong>group subtotals<br />
and grand totals that span chunks</strong> be handled?</li>
<li>How should <strong>memory and workers</strong> be sized for occasional very large renders (worker count,<br />
per-worker limits, Chrome strategy vs. server RAM)?</li>
<li>When a client sends many render requests at the same time, how does jsreport handle them<br />
beyond <code>numberOfWorkers</code>, and should the client limit how many it sends at once?</li>
<li>Are there template, recipe or layout practices you recommend for very long (2,000+ page)<br />
tabular PDFs with grouping and totals?</li>
</ol>
<p>Related threads: topic 1451 (totals repeating across parallel chunks), topic 492<br />
(reporting with a lot of data).</p>
<p>Thanks for any guidance!</p>
]]></description><link>https://forum.jsreport.net/topic/3545/large-aggregate-reports-crash-chrome-pdf-chunk-parallel-render-merge-works-for-flat-lists-but-breaks-group-subtotals-and-grand-totals-what-s-the-recommended-pattern</link><generator>RSS for Node</generator><lastBuildDate>Thu, 15 Oct 2026 23:16:03 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/3545.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 14 Oct 2026 23:07:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Large aggregate reports crash chrome-pdf: chunk + parallel render + merge works for flat lists but breaks group subtotals and grand totals. What&#x27;s the recommended pattern? on Invalid Date]]></title><description><![CDATA[<p>Hi jsreport team,</p>
<p>We use jsreport to render operational reports for a records-management system, and large<br />
reports regularly crash or time out. We built a chunk-and-parallelize workaround that works<br />
well for flat list reports, but it doesn't work for <strong>aggregate</strong> reports (grouped reports with<br />
subtotals, summary/statistics reports, cross-tabs). Those still go to jsreport as a single<br />
huge render and fail. We'd like to know the recommended architecture for this case.</p>
<h3>Environment</h3>
<ul>
<li>
<p>jsreport <strong>4.11.0</strong>, Node.js [version], Windows Server [version], hosted under <strong>IIS / iisnode</strong></p>
</li>
<li>
<p>Server: 8 GB RAM, 2 CPU cores</p>
</li>
<li>
<p>Client: .NET 10 API using the <code>jsreport.Client</code> NuGet package</p>
</li>
<li>
<p>Recipe: <code>chrome-pdf</code>, engine: <code>handlebars</code> (plus <code>pdfOperations</code> merge of a header template)</p>
</li>
<li>
<p>Config (relevant part):</p>
<p>{<br />
&quot;templatingEngines&quot;: { &quot;timeout&quot;: 1200000 },<br />
&quot;chrome&quot;: { &quot;timeout&quot;: 1200000 },<br />
&quot;reportTimeout&quot;: 1200000,<br />
&quot;workers&quot;: { &quot;numberOfWorkers&quot;: 6 },<br />
&quot;extensions&quot;: {<br />
&quot;scripts&quot;: { &quot;timeout&quot;: 1200000 },<br />
&quot;express&quot;: { &quot;inputRequestLimit&quot;: &quot;200mb&quot;, &quot;renderTimeout&quot;: 1200000 }<br />
}<br />
}</p>
</li>
</ul>
<h3>What fails</h3>
<ul>
<li>Typical failing report: ~10k+ rows, ~1000 pages expected</li>
<li>Playground reproduction with synthetic data: <a href="https://playground.jsreport.net/w/mdesaiATIMS/HgoUfkTW" rel="nofollow">https://playground.jsreport.net/w/mdesaiATIMS/HgoUfkTW</a></li>
<li>It did not let me save the full data with 35k rows that crashed the container in production environment. <img src="/uploads/files/1792018700922-upload-f86ed4a7-c18a-42be-ba36-5750e046a0ec-resized.png" alt="0_1792018695113_upload-f86ed4a7-c18a-42be-ba36-5750e046a0ec" class="img-responsive img-markdown" /></li>
</ul>
<h3>Our current workaround (works for flat lists)</h3>
<p>A SQL stored procedure returns the whole dataset as a JSON array. The .NET API then:</p>
<ol>
<li>Splits the array into chunks of <code>rowsPerPage * pagesPerChunk</code> rows</li>
<li>Sends every chunk to jsreport <strong>in parallel</strong> as separate render requests</li>
<li>Adds paging metadata to each chunk so the template knows where it is:</li>
<li>Merges the returned PDFs in .NET (PdfSharp) and stamps &quot;Page X of Y&quot; after the merge</li>
</ol>
<p>This is fast and stable for flat roster or list reports.</p>
<h3>Why it doesn't work for aggregate reports</h3>
<ul>
<li><strong>Group boundaries:</strong> chunks are cut by row count, so one group can be split across two chunks.<br />
The group header repeats and each half prints its own partial subtotal.</li>
<li><strong>Aggregates are per chunk:</strong> subtotals, counts and sums that are computed in Handlebars<br />
helpers or in the template only see their own chunk's rows. <code>{{Data.length}}</code>-style totals<br />
repeat in every chunk. This matches what was described in topic 1451 (&quot;Report generation<br />
takes too much time&quot;), which ended without a solution.</li>
<li><strong>Summary/statistics reports</strong> (counts by category x category, percentages of total) need<br />
the full dataset to produce even one page, so we can't split them at all. They go as one<br />
request with the whole JSON, and that is the request that crashes.</li>
</ul>
<h3>Questions</h3>
<ol>
<li>What is the recommended way to render large <strong>grouped / summary / aggregate</strong> reports in<br />
jsreport 4.x when the full dataset is too big for a single render, but the aggregates need<br />
all of the data?</li>
<li>When a report is split into multiple renders and then merged, how should <strong>group subtotals<br />
and grand totals that span chunks</strong> be handled?</li>
<li>How should <strong>memory and workers</strong> be sized for occasional very large renders (worker count,<br />
per-worker limits, Chrome strategy vs. server RAM)?</li>
<li>When a client sends many render requests at the same time, how does jsreport handle them<br />
beyond <code>numberOfWorkers</code>, and should the client limit how many it sends at once?</li>
<li>Are there template, recipe or layout practices you recommend for very long (2,000+ page)<br />
tabular PDFs with grouping and totals?</li>
</ol>
<p>Related threads: topic 1451 (totals repeating across parallel chunks), topic 492<br />
(reporting with a lot of data).</p>
<p>Thanks for any guidance!</p>
]]></description><link>https://forum.jsreport.net/post/14972</link><guid isPermaLink="true">https://forum.jsreport.net/post/14972</guid><dc:creator><![CDATA[mdesaiATIMS]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>