Exago .NET API Documentation
Action Property
Example 
WebReports.Api Namespace > Api Class : Action Property

The startup action for the Web Application to take when accessed via the GetUrlParamString Method. It may indicate to execute a report or open Exago directly in to the Report Designer or Report Wizard. The main menu in the user interface is disabled for all wrApiActions except Home.

Syntax
public wrApiAction Action {get; set;}

Property Value

One of the wrApiAction Enumeration members. If not provided, the action will be wrApiAction.Default. See Remarks below.
Exceptions
ExceptionDescription
System.Exception will be thrown if attempting to perform an action that requires a report, but there is no active report. (For example, if api.Action is wrApiAction.EditReport but there is no currently loaded active report)
Remarks
Although the Default Action when a report object is loaded is ExecuteReport, set the Action type explicitly in case the report fails to load. The fallback Action for Default is to load the full user interface, which may result in unintended user access to the application.
Example
On session startup, execute and load the appropriate Report Viewer for a given report.
using WebReports.Api;

public class Example
{
    string appPath = "http://localhost/exago/";
    string configFn = "WebReports.xml";
    string reportName = "Development Operations\\Failed Builds\\Fail Reasons";

    public static void Main()
    {
        // Instantiate the Api object and set the action
        Api api = new Api(appPath, "WebReports.xml")
        {
            Action = wrApiAction.ExecuteReport,
        };
        
        // Load a report for execution
        api.ReportObjectFactory.SaveToApi(api.ReportObjectFactory.LoadFromRepository(api.ReportObjectFactory.GetReportId(reportName)));
        
        // Redirect the browser to the UrlParamString
        Frame.Redirect(appPath + api.GetUrlParamString(homePage));
    }
}
See Also

Reference

Api Class
Api Members