
The Api class is the main interaction class between Exago BI and the host application. All API session parameters are accessed through this class.
An Api object should be the first thing that is created to interact with Exago BI.

public class Api
using WebReports.Api; using WebReports.Api.Reports; public class Example { string appPath = "http://localhost/exago/"; string configFn = "WebReports.xml"; string homePage = "ExagoHome"; string userId = "Alex"; string companyId = "Exago"; string roleId = "restricted"; string reportName = "Example Reports\\Client Report"; public static void Main() { // Instantiate the Api object Api api = new Api(appPath, configFn) { ShowTabs = false, Action = wrApiAction.ExecuteReport, }; // Set userId and companyId parameters api.Parameters.Add("userId", userId); api.Parameters.Add("companyId", companyId); // Activate a role api.Roles.GetRole(roleId).Activate(); // Load a report for execution Report report = (Report)api.ReportObjectFactory.LoadFromRepository(reportName); api.ReportObjectFactory.SaveToApi(report); // Get the paramString; this should be the last call made to the Api object string paramString = api.GetUrlParamString(homePage); // Redirect the browser Frame.Redirect(appPath + paramString); } }
System.Object
WebReports.Api.Api