Report Module takes a long time to generate PDF Report

I am having an issue where the Reporting Module takes a very long time to generate a PDF Report. The report is a 2 page report with the first page being an overview page of the build options for the work order and part numbers, etc. The second page contains the details of step completions for each work instruction for building the product (39 work instructions with up to 34 steps per instruction). The report comes out at 204 pages.

This report executes a stored procedure on SQL Server to pull the data. When looking at the Ignition logs this query has been taking anywhere from 1 minute to over 6 minutes to run. When I run the report through the client I get the "Read Timed Out" error over the Table Group. If I run the same report again, the report is displayed.

Running the same stored procedure in SQL Server directly, takes about 5 seconds. I created an Excel Spreadsheet that executes the same stored procedure and that takes at most 10 seconds to present the data.

Is there anything I can look at to speed up the PDF generation of the report? Our Quality team needs to pull a lot of these DHR reports and it is very time consuming.

Show how you are running the stored procedure in the report.

It's set as a Data Source.

Hmm.

Try to not use a named query. You might be getting some interactions with query caching.

The [dbo].[get_dhr_data] is the name of the Stored Procedure in SQL.
image
This is what is in the Designer for Named Queries for the report:
image