# SessionInfo

Custom Functions, Server Events, Action Events, and Assembly Data Sources can access the Exago session state through a "sessionInfo" variable. Access to sessionInfo allows powerful new capabilities such as the ability to persist values across function invocations, allowing each invocation to be aware of previous calls and behave accordingly.

## Properties

### PageInfo

This is the parent of all information in the current session. Included is the active Report and SetupData objects.

> NOTE. Since the Report and SetupData objects are accessed frequently, direct pointers are included for these objects.

### Report

An object that contains all of the report’s Data Object, sort, filter, and layout information.

### SetupData

An object that contains all of the session’s configuration settings including Functions, Parameters, Data Objects, Joins, Roles, etc.

### CompanyId

Contains the value specified by the companyId Parameter.

### UserId

Contains the value specified by the userId Parameter.

## Methods

### GetReportExecuteHtml (string reportName)

A method that executes the specified report and returns its html output. This could be used to embed a report within a cell of another report.

> NOTE. The 'reportName' is relative to the session’s report path.

### GetParameter (string parameterName)

A method that returns the specified Parameter Object. 'GetParameter' first looks in the Report Parameter collection, parameters being utilized by the report, and then in the Config Parameter collection, as well as other parameters such as hidden parameters or multi-tenant values.

### GetReportParameter (string parameterName)

A method that returns the specified Parameter object that is utilized by the report being executed.

> Ex. If a parameter is prompting a user for a value it will be available with the prompted value.

### GetConfigParameter (string parameterName)

A method that returns the parameter object stored in the default configuration.

> Ex. Any parameter that is not being utilized by the report being executed.

### WriteLog (string text)

A method that writes the specified text to the Exago’s log file.

> NOTE. The following methods utilize Stored Values which are objects that can be created and set by custom functions during report execution to pass data between custom function calls. Stored Values only exist for the duration of report execution.

### GetStoredValue (string valueName, object initialValue = null)

A method that retrieves a Store Value. If a there is no Stored Value with the specified valueName, then one will be created with the specified initialValue.

### SetStoredValue (string valueName, object newValue)

A method that sets the value of a Store Value. Setting newValue to 'null' will delete the Stored Value.

## Calling Functions

To call an existing function from within your extension, use the class CellFormula and return the method CellFormula.Evaluate(null).

### Example

    CellFormula formula = CellFormula.CreateFormula(sessionInfo.PageInfo, formulaText, CellVariableCollectionFilter.DataField);
    return formula.Evaluate(null);

CellVariableCollectionFilter types:

DataField
AggFunction
CellReference
LinkedReport
Parameter
WidgetCellReference
All