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.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to 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?