TOC shows no page numbers for big reports with cache activated

Stimulsoft Reports.NET discussion
Post Reply
CErdmann
Posts: 1
Joined: Thu Feb 05, 2026 5:17 pm

TOC shows no page numbers for big reports with cache activated

Post by CErdmann »

Hi Stimulsoft Team,

at Fresenius Kabi Deutschland GmbH we have to generate PDF reports having sometimes even more than 1000 pages.
Our first approach to use the JS version in the frontend of our app failed, because it needs to much time and RAM.
So, we decided to use the .NET version (2026.1.3) on the backend.

To prevent an overload of the backend we use the report cache (ReportCacheMode = On or Auto) to control the RAM consumption.
This works good in general, but we identified a showstopper.

The Table of Contents component works correctly only for small reports up to about 40 pages.
But beyond 50 pages the TOC shows no page numbers, if we activate the report cache (mode = On or Auto with LimitForStartUsingCache < number of pages).
This appears even, if the TOC contains just one entry and the additional pages include nothing to display in the TOC.

To reproduce the issue we created a simple sample report.
It consists of one page with the TOC and a second page with one data band with the text entry for the TOC and another data band bound to a JSON datasource to create the additional pages.

The sample report is not faulty, because it works perfect with the JS version.
So, this seems to be a bug in the interaction of the TOC component and the report cache in the .NET version.

Can you confirm that this is a bug?
While waiting for a fix: Is there something we can change in our templates, so that the TOC will work for big reports with cache in .NET 2026.1.3?

Please find attached the sample report and JSON data files to generate reports with 20, 40, 50, 80 pages.

The program to execute can be as simple as that:

report = new StiReport();
report.Load(args[0]);
var dataSet = StiJsonToDataSetConverterV2.GetDataSetFromFile(args[1] + ".json");
report.Dictionary.Databases.Clear();
report.RegData("JSON", "", dataSet);
report.ReportCacheMode = (StiReportCacheMode)int.Parse(args[2]);
if (report.ReportCacheMode == StiReportCacheMode.Auto)
{
StiOptions.Engine.ReportCache.LimitForStartUsingCache = 10;
}
var renderState = new StiRenderState(false);
_ = await report.RenderAsync(renderState);
_ = await report.ExportDocumentAsync(StiExportFormat.Pdf, args[1] + ".pdf");

Thanks in advance for checking this issue.
Attachments
TOC_test.mrt
A sample report, stripped to the bone
(5.16 KiB) Downloaded 7 times
pages_80.json
Generates 80 pages
(1.27 KiB) Downloaded 7 times
pages_50.json
Generates 50 pages
(818 Bytes) Downloaded 7 times
pages_40.json
Generates 40 pages
(658 Bytes) Downloaded 7 times
pages_20.json
Generates 20 pages
(338 Bytes) Downloaded 7 times
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: TOC shows no page numbers for big reports with cache activated

Post by HighAley »

Hello,

We need some time to analyse the issue, and we will let you know as soon as we have any results.

Thank you.

Ticket reference: #19462
Post Reply