Getting report data

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

The following sample code shows how you can get a report category as a ReportCategoryInfo object and a report as a ReportInfo object:

 

[C#]

 

using CMS.Reporting;

 

...

     

        // Get report category object by category code name

        ReportCategoryInfo rci = ReportCategoryInfoProvider.GetReportCategoryInfo("WebAnalytics");

 

        // Get report category object by category ID

        ReportCategoryInfo rci2 = ReportCategoryInfoProvider.GetReportCategoryInfo(1);

 

        // Get report category object by report ID

        ReportInfo ri = ReportInfoProvider.GetReportInfo(1);

 

        // Get report category object by report code name

        ReportInfo ri2 = ReportInfoProvider.GetReportInfo("TestReport");

 

The following sample code shows how you can get a DataSet containing report categories or reports from the system:

 

[C#]

 

using System.Data;

using CMS.Reporting;

 

...

 

        string where = "CategoryID > 10";

        string orderby = "CategoryDisplayName";

        int topN = 10;

        string selectedColumns = "CategoryID, CategoryDisplayName";

 

        // Get dataset of report categories according to the given parameters

        DataSet ds = ReportCategoryInfoProvider.GetCategories(where, orderby);

 

        DataSet ds2 = ReportCategoryInfoProvider.GetCategories(where, orderby, topN, selectedColumns);

 

 

        string where2 = "ReportCategoryID = 12";

 

        // Get DataSet of reports with a specified where condition

        DataSet ds3 = ReportInfoProvider.GetReports(where2);

 

Page url: http://devnet.kentico.com/docs/5_5r2/devguide/index.html?api_getting_report_data.htm