Sometimes, generating a report can take a long time, especially if there is a large number of records in the report’s data source.
In this post, we’ll look at an example involving a Project Invoice template, which initially took around 45 minutes to generate with almost 10,000 lines, which was far from ideal.
When report generation is slow, the first thing to examine is how the report’s data source is being built. This means reviewing your DSP class and all the methods it contains. You can add timestamps to identify which methods take the most time. Then, go a step further and place timestamps within specific lines of code to pinpoint exactly where the overhead lies - your typical debugging process.
More specifically in the context of Docentric, the difference in performance between the plain SSRS report and the report run with Docentric usually stems from additional processing in the DSP class. Some of this logic resides in the standard DocPsaProjInvoiceDSP class, while the rest is in your extension, if you have made one.
After reviewing and optimizing your report’s DSP class, the next step would be to check how the Docentric template itself is designed, especially the tagging elements.
In this particular example, the template included a Group tagging element. Inside this group, there was a List tagging element traversing through all the elements of the group, sorted by the field Item name.
That means that for every group created, the sorting is done inside the List tagging element for each group.
Now, let’s make just one small improvement here – by sorting the Group tagging element by the Item name field in addition to the already existing Category field. This ensures the records are pre-sorted during grouping, so by the time they’re displayed in the List tagging element, the items will already be ordered, resulting in faster rendering.
After this simple modification, the report generation time went down considerably.
Key takeaway:
Whenever you’re dealing with large volumes of records, it’s important to minimize processing in the innermost elements of your template.
Instead, do as much sorting and filtering as early as possible, ideally at the data source or in outer-level elements, to reduce overhead and improve performance.


