Exago .NET API Documentation
Load Reports in the .NET API

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:

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.