{"title":"Report performance","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-report-performance/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-report-performance, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-report-performance","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Provides information for developers to help improve performance for Business Central reports.","date":"2024-01-18","meta":{"topic":"article"},"outline":[{"level":2,"title":"Analyzing report performance telemetry","slug":"analyzing-report-performance-telemetry","at":1811,"chars":6001},{"level":3,"title":"Sample KQL code","slug":"sample-kql-code","at":2319,"chars":3148},{"level":3,"title":"Tuning potential","slug":"tuning-potential","at":5467,"chars":597},{"level":3,"title":"Calculating time to compute the dataset and to render the report (apply the layout)","slug":"calculating-time-to-compute-the-dataset-and-to-render-the-report-apply-the-layout","at":6064,"chars":506},{"level":3,"title":"Checking if Read Scale-Out is used on reports","slug":"checking-if-read-scale-out-is-used-on-reports","at":6570,"chars":319},{"level":3,"title":"Checking if reports run in the background","slug":"checking-if-reports-run-in-the-background","at":6889,"chars":403},{"level":3,"title":"Calculating how set-based the report dataset loads data","slug":"calculating-how-set-based-the-report-dataset-loads-data","at":7292,"chars":520},{"level":2,"title":"Report limit (maximum execution time that it can take to generate a report)","slug":"report-limit-maximum-execution-time-that-it-can-take-to-generate-a-report","at":7812,"chars":396},{"level":2,"title":"Related information","slug":"related-information","at":8208,"chars":487}],"text":"Reports generally fall into two categories. They can be specific to a single instance of an entity, like an invoice. Or, they can be of a more analytical nature that joins data from multiple instances of multiple entities. Typically, performance issues in reports lie in the latter category. The following articles contain advice about implementing faster reports:\n Use Read Scale-Out to read data from a read-only copy of the database, see Using Read Scale-Out for Better Performance<../administration/database-read-scale-out-overview> for more information.\n Use Partial Records to reduce the data loaded from the database, see Using Partial Records<devenv-partial-records> for more information.\n Use AL queries to optimize the way data is read from the database, see Queries in Business Central<devenv-query-overview> for more information.\n Compared to Word layouts, RDL layouts can result in slower performance with document reports, especially for actions related to the user interface (like sending emails). See Creating an RDL Layout Report<devenv-howto-rdl-report-layout>.\n Can you run the report in the background? It will not make it run faster, but the user might feel this way (as they are not blocked in the UI while waiting on the report to finish). See /ui-work-report#ScheduleReport.md.\n> TIP\n> From the Business Central client, you can export report results as raw data to a Microsoft Excel file. The file contains all columns of the dataset, but without the layout applied. Use the file to help validate that the report returns the expected data, and to ensure that the report layout controls match the dataset value types. To export a report dataset to Excel, run the report and select the Send to > Microsoft Excel Document (data only) on the request page. See /ui-work-report#send-to-excel.\n## Analyzing report performance telemetry\nReport telemetry gathers data about which reports are run on the environment. It provides information about whether the report succeeded, failed, or was canceled. For each report, it tells you how long it ran, how many SQL statements it executed, and how many rows it consumed. You use this data to gather statistics on report usage or to help identify slow-running reports.\nFor more information about report telemetry, see ../administration/telemetry-reports-trace\n### Sample KQL code\nThis KQL code can help you get started analyzing report rendering:\n```kql\ntraces\n| where timestamp > ago(60d) // adjust as needed\n| where customDimensions has 'RT0006'\n| where customDimensions.eventId == 'RT0006'\n// | where operation_Name == \"Success report generation\" // use this instead of eventId clause for versions 16.0 or earlier\n| where customDimensions.result == \"Success\"\n| project timestamp\n// in which environment/company did it happen\n, aadTenantId = customDimensions.aadTenantId\n, environmentName = customDimensions.environmentName\n, environmentType = customDimensions.environmentType\n, companyName = customDimensions.companyName\n// in which extension/app\n, extensionId = customDimensions.extensionId\n, extensionName = customDimensions.extensionName\n, extensionVersion = customDimensions.extensionVersion\n, extensionPublisher = customDimensions.extensionPublisher\n// in which object\n, alObjectId = customDimensions.alObjectId\n, alObjectName = customDimensions.alObjectName\n, alObjectType = customDimensions.alObjectType\n// what did the user do\n, documentFormat = customDimensions.documentFormat   // documentFormat dimension added in version 20.0\n, LayoutAppId = customDimensions.layoutAppId         // layout dimensions added in version 20.0\n, LayoutName = customDimensions.layoutName           // layout dimensions added in version 20.0\n, LayoutType = customDimensions.layoutType           // layout dimensions added in version 20.0\n, ThemeLayoutAppId = customDimensions.themeLayoutAppId                 // added in version 29.0\n, ThemeLayoutName = customDimensions.themeLayoutName                   // added in version 29.0\n, HeaderFooterLayoutAppId = customDimensions.headerFooterLayoutAppId   // added in version 29.0\n, HeaderFooterLayoutName = customDimensions.headerFooterLayoutName     // added in version 29.0\n, reportAction = customDimensions.reportAction       // reportAction dimension added in version 20.0\n, reportingEngine = customDimensions.reportingEngine // reportingEngine dimension was added in version 17.3\n// which user ran the report\n, usertelemetryId = case(\n  toint( substring(customDimensions.componentVersion,0,2)) >= 20, user_Id // user telemetry ID was introduced in the platform in version 20.0\n, 'N/A'\n)\n// performance data\n, numberOfDocuments = customDimensions.numberOfDocuments\n, numberOfRows = customDimensions.numberOfRows\n// , serverExecutionTime = customDimensions.serverExecutionTime // the datatype for executionTime is timespan\n, serverExecutionTimeInMS = toreal(totimespan(customDimensions.serverExecutionTime))/10000 // this shows how to convert timespan to milliseconds\n, sqlDatabaseAccessIntent = customDimensions.sqlDatabaseAccessIntent  // sqlDatabaseAccessIntent dimension added in version 19.1\n, sqlExecutes = customDimensions.sqlExecutes\n, sqlRowsRead = customDimensions.sqlRowsRead\n// , totalTime = customDimensions.totalTime // the datatype for totalTime is timespan\n, totalTimeInMS = toreal(totimespan(customDimensions.totalTime))/10000 // this shows how to convert timespan to milliseconds\n| extend renderTimeInMS = totalTimeInMS - serverExecutionTimeInMS\n```\n### Tuning potential\nWhen looking at telemetry data for report performance, the following strategies might be helpful for identifying reports to optimize:\n aggregate the sum of execution time by report and sort by sum descending. High sum values show the reports that consume a lot of resources.\n aggregate the count of report executions by report and sort by count descending. High number of renderings show the reports that are run the most.\n aggregate the average execution time by report and sort by average descending. Reports with high average execution time could be candidates for tuning.\n### Calculating time to compute the dataset and to render the report (apply the layout)\nThe time spent to run a report consists of two parts: generating the dataset and rendering the report (applying the layout). In report telemetry, you get two durations: serverExecutionTime and totalTime. The former is roughly the time it takes for the server to generate the dataset. To calculate the rendering time, simply subtract serverExecutionTime from totalTime: renderingTime = totalTime - serverExecutionTime.\n### Checking if Read Scale-Out is used on reports\nAs mentioned in the list above, the _Read Scale-Out_ feature can be used to load-balance read-only workloads to a read-only replica of the database (where supported).\nThe use of _Read Scale-Out_ in reports is captured in the custom dimension _sqlDatabaseAccessIntent_.\n### Checking if reports run in the background\nAs mentioned in the list above, you if you can schedule reports to run in the background, users might feel that the application runs fast as they are not blocked in the UI while waiting on the report to finish.\nThe use of UI sessions vs. background sessions in reports is captured in the custom dimension _clientType_.\nSee /ui-work-report#ScheduleReport.md\n### Calculating how set-based the report dataset loads data\nCalculate the ratio SQL rows/SQL statement. The higher this number is, the more set-based the data is loaded (which is good). So, look for low values of this ratio to identify reports, where you might be able to use a query as the datasource.\nFor more information about how to use a query in a dataset definition, see Defining a report dataset<devenv-report-dataset>.\nFor more information about queries, see Queries in Business Central<devenv-query-overview>.\n## Report limit (maximum execution time that it can take to generate a report)\nThe Business Central platform has built-in limits to protect the stability of the system from a single report consuming too many resources. For example, there's a limit on the maximum execution time that it can take to generate a report.\nFor more information on report limits, see devenv-report-object#report-limits.\n## Related information\n../performance/performance-overview\nPerformance Topics For Developers<../performance/performance-developer>\nHow Application Configurations Affect Performance<../performance/performance-application>\n../performance/performance-online\nPerformance of On-Premises Installations<../performance/performance-onprem>\n../performance/performance-work-perf-problem\nPerformance tips for business users<../performance/performance-users>\n../administration/telemetry-reports-trace"}