Add your custom report

The Sitefinity CMS Diagnostics module provides developers with the option to display diagnostics information using custom reports. Apart from using Sitefinity's built-in custom reports, you can create your own report reflecting your diagnostics requirements.

Custom reports are basically stored procedures from the diagnostics database. Such stored procedures have names that start with the prefix sf_diag_report_.  In addition, these stored procedures are displayed in the diagnostics user interface (UI), so that you can execute them. Note that the prefix is not displayed in the user interface. For example, Sitefinity's two built-in custom reports' names – RunBigResultSetAnalysis and  RunLongQueryAnalysis - are stored in the database as sf_diag_report_RunBigResultSetAnalysis and sf_diag_report_RunLongQueryAnalysis respectively.

To create your custom report, you need to add a new stored procedure in the diagnostics database. When creating your stored procedure, you put parameters that define the conditions for generating the required diagnostics reports. These parameters are extracted and a dynamic UI is constructed by the system.You can use two types of controls, that is, UI elements - a TextBox and a DateTimePicker. The text box serves as input field for all basic data types – int, string, bool, GUID, and so on.

Each report can return different results. The grid is automatically populated with those results.

Create a new stored procedure

  1. Open the tool you are using for accessing your database.
  2. Add your new stored procedure.
    Following is an example of a stored procedure that selects all columns from the OperationLog table and returns only the ones that correspond to the desired category:

As a result, your new report is added in the diagnostics UI as an additional custom report and you can run it.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?