Exago Logo
Search
Generic filters
Exact matches only

Load Reports in the .NET API

Note

This version of the .NET API documentation is deprecated. A new version can be found at https://www.exagoaccess.com/api-docs/.

The ReportObject Class

All Report type objects inherit from ReportObject. The class includes basic functions such as loading and saving the objects. Report type objects consist of simple report types such as ExpressView and Advanced, and composite types such as Dashboard and Chained.

Accessing Reports via the API

A Report is normally loaded via API in order to launch directly into the execution or editing of the report. In most cases, report loading is handling by the Exago runtime via the LoadFromRepository call. LoadFromRepository returns an object of type ReportObject.

In order for the load to complete, a corresponding SaveToApi is done. SaveToApi will save the ReportObject, including any modifications back to the API for loading (for execution or editing). Both LoadFromRepository and SaveToApi can be accessed via the Api.ReportObjectFactory property. 

Both LoadFromRepository and SaveToApi return and store a ReportObject respectively. Most modifications made to a report loaded at runtime (such as changing filter values) are performed on properties defined within the child types (such as Report or DashboardReport). Such modifications would require a cast of the ReportObject to the appropriate child type.

If no modifications are required, the sequence is simple: 

//Load the report -- Refers to the full folder path
//Followed by the report name
ReportObject ro = api.ReportObjectFactory.LoadFromRepository();
//Save the report back to the API
api.ReportObjectFactory.SaveToApi(ro);

If modifications are desired, it is necessary to cast the value returned by LoadFromRepository to the appropriate base type. Supported base types include:

  • WebReports.Api.Reports.Report for Advanced, CrossTab and Express Reports.
  • WebReports.Api.Composite.Dashboard.DashboardReport for Dashboards.
  • WebReports.Api.Composite.Chained.ChainedReport for Chained Reports.

For example, you can modify Filters on a report to be executed as follows:

//Load the report -- Refers to the full folder path
//Followed by the report name
Report report = api.ReportObjectFactory.LoadFromRepository() as Report;
report.Filters[0].Value = ;
//Save the report back to the API
api.ReportObjectFactory.SaveToApi(report);

Note

The filter change will only apply to this execution of the report. The report design itself will not be modified.

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents