The report generator supports the events, which give an ability to make necessary operations before definite actions both on the JavaScript client-side and on the PHP server-side. You don't need any additional settings for work of events on the client-side. However, for work of events on the server-side you should add a special event handler to the page. You can find a detailed description of connection and the PHP event handler setting in the PHP Events Handler chapter.

 

The report generator supports the following events:

onBeforeRender
onBeginProcessData
onEndProcessData
onPrepareVariables

 

 

onBeforeRender

The event is called before the report is rendered. See the list below with the event handler arguments on the JavaScript client side:

 

Name

Description

event

The identifier of the current event is "BeforeRender".

sender

The identifier of the component that initialized this event can take the following values:

Report

report

The current report object.

 

 

onBeginProcessData

This event is invoked before data request, which are needed for rendering a report. The list of the event handler arguments on the JavaScript client-side is presented in the table below.

 

Name

Description

event

The identifier of the current event has the "BeginProcessData" value.

sender

The identifier of the component, which initialized this event can take the following values:

Report
Viewer
Designer

report

Current report object

command

The identificator of the current command can take the following values:

TestConnection - a connection check is performed;
ExecuteQuery - data query is performed from the specified SQL source.
GetSchema - the XSD scheme is read from a file source.
GetData - data is read from a file source.

connection

The name of the current connection to a data source, specified in report template.

connectionString

Connection string to the SQL data source.

queryString

The SQL query for getting data. It is used only with the ExecuteQuery command.

database

The name of the current database. It can take the following values:

XML
JSON
Excel
CSV
MySQL
MS SQL
PostgreSQL
Firebird
Oracle

pathData

The path to the data source file, specified in the report template. It's set only for XML and JSON data sources.

pathSchema

The path to the data scheme file, specified in the report template. It is set only for XML data source.

dataSource

The name of the current data source, specified in the report template. It is set only for SQL data sources.

parameters

The collection of parameters and their values, specified in an SQL data source.

preventDefault

This flag is an ability to stop further event processing by the report generator. The false value is set by default.

 

 

In the table below, you can find the list of event handler arguments on the PHP server-side.

 

Name

Description

sender

The identificator of the component, which initialized this event can take the following values:

StiComponentType::Report
StiComponentType::Viewer
StiComponentType::Designer

command

The identificator of the current command can take the following values:

StiDataCommand::TestConnection - the connection is checked;
StiDataCommand::ExecuteQuery - the data is required from a specified SQL source.

connection

The name of the current connection to a data source, specified in report template.

connectionString

Connection string to the SQL data source.

queryString

The SQL query for getting data. It is used only with the StiDataCommand::ExecuteQuery command.

database

The name of the current database. It can take the following values:

StiDatabaseType::MySQL
StiDatabaseType::MS SQL
StiDatabaseType::PostgreSQL
StiDatabaseType::Firebird
StiDatabaseType::Oracle

dataSource

The name of the current data source, specified in report template.

 

 

You can find a detailed description and samples of using in the Connecting Data Files and Connecting SQL data adapters chapters.

 

onEndProcessData

The event is invoked after data loading before rendering a report. In the table below you can find the list of the event handler arguments on the side of JavaScript client.

 

Name

Description

event

The identificator of the current event has the "EndProcessData" value.

sender

The identificator of the component, which initialized this event can take the following values:

Report
Viewer
Designer

report

Current report object.

command

The identificator of the current command can take the following values:

ExecuteQuery - data is obtained from the specified SQL source.
GetData - data is obtained from a file source.

connection

The name of the current connection to a data source, specified in report table.

database

The name of the current database. It can take the following values:

XML
JSON
Excel
CSV
MySQL
MS SQL
PostgreSQL
Firebird
Oracle

dataSource

The name of the current data source, specified in report template. It is set only for SQL data sources.

dataSet

The prepared Stimulsoft.System.Data.DataSet object contains tables and data rows, received from a file source.

result

The collection of columns, their types and data rows, received from an SQL source.

 

 

In the table below, you can find the list of the event handler arguments on the PHP server-side.

 

Name

Description

sender

The identificator of the component, which initialized this event can take the following values:

StiComponentType::Report
StiComponentType::Viewer
StiComponentType::Designer

command

The identificator of the current command can take the following values:

StiDataCommand::TestConnection - the connection is checked;
StiDataCommand::ExecuteQuery - data is queried from the specified SQL source.

connection

The name of the current connection to a data source, specified in report template.

database

The name of the current database. It can take the following values:

StiDatabaseType::MySQL
StiDatabaseType::MS SQL
StiDatabaseType::PostgreSQL
StiDatabaseType::Firebird
StiDatabaseType::Oracle

dataSource

The name of the current data source, specified in report template. It is set only for SQL data sources.

result

The collection of columns, their types and data rows, received from an SQL source.

 

 

You can find a detailed description and samples of using in the Connecting Data Files and Connecting SQL data adapters chapters.

 

 

onPrepareVariables

This event is invoked before rendering a report after preparing the report variables. In the table below, you can see the list of the event handler arguments on the JavaScript client-side:

 

Name

Description

event

The identificator of the current event has the "PrepareVariables" variable.

sender

The identificator of the component, which initialized this event can take the following values:

Report
Viewer
Designer

report

Current report object.

variables

The collection of report variables and their values.

preventDefault

This flag gives an ability to stop the further event handler by the report generator. The false value is set by default.

 

 

In the table below you can find the list of the event handler arguments on the PHP server-side:

 

Name

Description

sender

The identificator of the component, which initialized this event can take the following values:

StiComponentType::Report
StiComponentType::Viewer
StiComponentType::Designer

variables

The collection of report variables and their values.

 

 

You can find a detailed description and samples of using in the Work with report variables chapter.