# WebReports.Api

## Api Class

The Api class is the main interaction class between Exago and the host application. All API session parameters are accessed through this class.

> NOTE. An Api object should be the first thing that is created to interact with Exago.

An Api object has the following properties:

- Action – Value that may indicate to execute a report or open Exago directly to the Report Design Grid or New Report Wizard. For the values ‘EditReport’, ‘NewReport’, ‘NewCrossTabReport, and ‘NewExpressReport’ the main menu will be disabled.
  - Uses the enumeration wrApiAction(Default, Home, ExecuteReport, EditReport, NewReport, NewCrossTabReport, NewExpressReport, NewDashboardReport, ScheduleReport, ScheduleReportManager).
  - If you have a Report object loaded then the value of Default will execute the report directly. Otherwise it will open the home page.
- AppVirtualPath – IIS virtual directory of Exago’ location. This should be set to an absolute path (i.e. /ExagoWebSite/Exago).
- DataSources – DataSources collection.
- Parameters – Parameters collection.
- ReportObjectFactory – Used to manage all report objects within the application.
- ReportScheduler – Scheduler object.
- Roles – Roles collection.
- ShowTabs – Boolean value. Set to False to hide the tabs and help button of Exago.
- DefaultReportName – String value used in conjunction with api.Action.
  - When api.Action is set to NewReport, NewCrossTabReport or NewExpressReport: The DefaultReportName provides the full path name for the report. The Info tab of the new report wizard will be hidden and the report designer will not display menus to rename the report or change its description.
  - When api.Action is set to EditReport: If DefaultReportName is any non-empty value the report designer will not display menus to rename the report or change its description.

An Api object has the following methods:

#### Constructor( )

Remark | Do not call this method from the .NET Api.

#### Constructor(string appVirtualPath)

Description | Initializes an Api object and sets the AppVirtualPath.
Remarks | Return value is void.

#### Constructor(string appVirtualPath, string configFile)

Description | Initializes an Api object, sets the AppVirtualPath and loads the specified configuration.
Remarks | Can be used to load configuration other than WebReport.xml. Return value is void.

#### Constructor(string appVirtualPath, string configFile, string azurePath)

Description | Initializes an Api object, sets the AppVirtualPath and loads the specified configuration from Azure.
Remarks | The specified Azure path must match that is app.config in the Exago installation. See Azure Cloud Support for more information. Return value is void.

#### GetUrlParamString( )

Description | Calls GetUrlParamString(“ExagoHome”)
Remarks | Return value is void.

#### GetUrlParamString(string webPageName)

Description | Returns the URL parameter string used to redirect browser or frame to Exago. Append this string to your Exago URL.

#### GetUrlParamString(string webPageName, boolean showErrorDetail)

Description | Returns the URL parameter string used to redirect browser or frame to Exago. Append this string to your Exago URL. Set showErrorDetail to True to display detailed error messages.