Viewer Events
The viewer 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. To make events work on the client-side, you don't need any additional settings. To make events work on the server-side, you should add a special event handler to the page. You can find a detailed description of connection and setting the PHP event handler in the PHP Events Handler chapter.
The viewer supports the following events:
The event is invoked before data request, which needed to render a report. The list of arguments of the event is in the Engine Events chapter. You can find a detailed description and samples of using in the Connecting Data Files and Connecting SQL Data Adapters chapters.
The event is invoked after loading data before rendering a report. The list of the event arguments are in the Engine Events chapter. You can find a detailed description and samples of using in the Connecting Data Files and Connecting SQL Data Adapters chapters.
The event is invoked before rendering a report after preparing report variables. The list of the event arguments is in the Engine Events chapter. You can find a detailed description and samples of using in the Work with Report Variables chapter.
The event is invoked before printing a report. In the table below, you can find the list of the event handler arguments on the JavaScript client-side.
Name |
Description |
||||||
event |
The identifier of the current event has the "PrintReport" value. |
||||||
sender |
The identifier of the component, which initiated this event can take the following values:
|
||||||
report |
Current report object. |
||||||
printAction |
The type of report print. It can take the following values:
|
||||||
fileName |
Report file's name for saving. |
||||||
preventDefault |
This flag gives an ability to stop further event processing by the viewer. 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 identifier of the component, which initiated this event can take the following values:
|
||||||
printAction |
Report print type. It can take the following values:
|
||||||
fileName |
Report file name for saving. |
You can find a detailed description and samples of using in the Printing Report chapters.
The event is invoked before exporting a report after the dialog of export settings. In the table below, you can see the list of the event handler argument on the JavaScript client-side.
Name |
Description |
||||||||||||||||||||||||||
event |
The identifier of the current event has the "BeginExportReport" value. |
||||||||||||||||||||||||||
sender |
The identifier of the component, which initiated this event can take the following values:
|
||||||||||||||||||||||||||
action |
The action, which initiated export event can take the following values:
|
||||||||||||||||||||||||||
report |
Current report object. |
||||||||||||||||||||||||||
format |
Selected report export format. It can take the following values:
|
||||||||||||||||||||||||||
formatName |
Name of a selected report export format corresponds to the name of the constants in format list. |
||||||||||||||||||||||||||
settings |
Settings of a selected export format. List of available properties will depend on a selected export type. |
||||||||||||||||||||||||||
fileName |
Report file name for saving after export completed. |
||||||||||||||||||||||||||
openAfterExport |
The flag indicates that a report will be exported in a new browser tab (the true value) or after export completed file saving will be invoked (the false value). |
||||||||||||||||||||||||||
preventDefault |
This flag gives an ability to stop furher event processing by the viewer. The false value is set by default. |
In the table below, you can see the list of event handler argument on the PHP server-side.
Name |
Description |
||||||||||||||||||||||||||
sender |
The identifier of the component, which initiated this event can take the following values:
|
||||||||||||||||||||||||||
action |
The action, which invoked export event can take the following values:
|
||||||||||||||||||||||||||
format |
Selected report export format. It can take the following values:
|
||||||||||||||||||||||||||
formatName |
Name of a selected report export corresponds to the name of constants in the format list. |
||||||||||||||||||||||||||
fileName |
Report file name for saving after export completed. |
||||||||||||||||||||||||||
settings |
Settings of a selected export format. List of available properties will depend on a selected export type. |
You can find a detailed description and samples of using in the Report Export chapter.
The event is invoked after exporting a report till its saving as a file. In the table below, you can see the list of the event handler argument on the JavaScript client-side.
Name |
Description |
||||||||||||||||||||||||||
event |
The identifier of the current event has the "EndExportReport" value. |
||||||||||||||||||||||||||
sender |
The identifier of the component, which initiated this event can take the following values:
|
||||||||||||||||||||||||||
report |
Current report object. |
||||||||||||||||||||||||||
format |
Selected report export format. It can take the following values:
|
||||||||||||||||||||||||||
formatName |
Name of a selected report export corresponds to the name of constants in the format list. |
||||||||||||||||||||||||||
data |
Byte data of an exported report, prepared for saving to a file. |
||||||||||||||||||||||||||
fileName |
Report file name for saving after export completed. |
||||||||||||||||||||||||||
openAfterExport |
The flag indicates that a report will be exported in a new browser tab (the true value) or after export completed file saving will be invoked (the false value) |
||||||||||||||||||||||||||
preventDefault |
This flag gives an ability to stop further event processing by the viewer. The false value is set by default. |
In the table below, you can see the list of the event handler argument on the PHP server-side.
Name |
Description |
||||||||||||||||||||||||||
sender |
The identifier of the component, which initiated this event can take the following values:
|
||||||||||||||||||||||||||
format |
Selected report export format. It can take the following values:
|
||||||||||||||||||||||||||
formatName |
Name of a selected report export corresponds to the name of constants in the format list. |
||||||||||||||||||||||||||
data |
Byte data of an exported report, prepared for saving to a file. |
||||||||||||||||||||||||||
fileName |
Report file name for saving after export completed. |
||||||||||||||||||||||||||
fileExtension |
Report file extension for saving after the export completed corresponds to the type of a selected format. |
You can find a detailed description and samples of using in the Report Export chapter.
The event is invoked while interactive action of the viewer (dynamic sorting, collapsing, drill-down, applying of parameters) until processing values by the report generator. In the table below, you can see the list of the event handler argument on the JavaScript client-side.
Name |
Description |
||||||
event |
The identifier of the current event has the "Interaction" value. |
||||||
sender |
The identifier of the component, which initiated this event can take the following values:
|
||||||
report |
Current report object. |
||||||
action |
The identifier of the current interactive action can take the following values:
|
||||||
variables |
The collection of report variables and their values, set in the parameter panel. |
||||||
sortingParameters |
The collection of parameters, needed for dynamic report sorting. |
||||||
collapsingParameters |
The collection of parameters needed for dynamic report elements collapsing. |
||||||
drillDownParameters |
The collection of parameters, needed for report drilldown. |
You can find a detailed description and samples of using in the Dynamic Sorting, Collapsing, and Drill-Down chapter.
The event is invoked after exporting a report before sending it by Email. In the table below, you can see the list of the event handler argument on the JavaScript client-side.
Name |
Description |
||||||||||||||||||||||||||
event |
The identifier of the current event has the "EmailReport" value. |
||||||||||||||||||||||||||
sender |
The identifier of the component, which initiated this event can take the following values:
|
||||||||||||||||||||||||||
report |
Current report object. |
||||||||||||||||||||||||||
format |
Selected report export format. It can take the following values:
|
||||||||||||||||||||||||||
formatName |
Name of a selected report export corresponds to the name of constants in the list of formats. |
||||||||||||||||||||||||||
data |
Byte data of an exported report, prepared for sending by Email. |
||||||||||||||||||||||||||
fileName |
Report file name for sending by Email. |
||||||||||||||||||||||||||
settings |
The object, which contains parameters, filled in the viewer dialog of sending a report by Email. The description of all parameters is in a separate table below. All the parameters must be filled (they can be checked and filled on the PHP server-side). |
In the table below you can see the list of parameters of sending Email on the JavaScript client-side.
Name |
Description |
The Email address, which will receive an exported report. |
|
subject |
Email theme. |
message |
Email text. |
In the table below, you can see the list of the event handler argument on the PHP server-side.
Name |
Description |
||||||||||||||||||||||||||
sender |
The identifier of the component, which initiated this event can take the following values:
|
||||||||||||||||||||||||||
format |
Selected report export format. It can take the following values:
|
||||||||||||||||||||||||||
formatName |
Name of a selected report export corresponds to the name of constants in the list of formats. |
||||||||||||||||||||||||||
data |
Byte data of an exported report, prepared for sending by Email. |
||||||||||||||||||||||||||
fileName |
Report file name for sending by Email. |
||||||||||||||||||||||||||
settings |
The object, which contains parameters, filled in the viewer dialog of sending a report by Email. The description of all parameters is in a separate table below. |
In the table below you can see the list of parameters of sending Email on the PHP server-side:
Name |
Description |
from |
Email address of a Email sender. |
name |
Name and surname of a Email sender. |
to |
The email address which will receive an exported report is transferred from the viewer dialog window. |
subject |
Email theme is transferred from the viewer dialog window. |
message |
Email text is transferred from the viewer dialog window. |
attachmentName |
Report name in attachment. Report file name is used by default. |
charset |
The coding, used for Email text. The "UTF-8" is used by default. |
host |
The SMPT server is mandatory to fill in. |
port |
The SMPT port server. The 465 is used by default. |
secure |
The type of connection encryption with mail server, the "ssl" can be used (by default) or "tls" encryption. |
login |
The log in of connection to the mail server is mandatory to fill in. |
password |
Password for connection to the mail server is mandatory to fill in. |
cc |
The CC array (Carbon Copy) addresses of secondary Email recipients. |
bcc |
The BCC array (Blind Carbon Copy) of addresses of hidden Email recipients. |
You can find a detailed description and samples of using in the Sending Report by Email chapter.
The event is invoked when clicking the Design button in the viewer panel. In the table below you can see the list of the event handler argument on the JavaScript client-side.
Name |
Description |
||
event |
The identifier of the current event has the "DesignReport" value. |
||
sender |
The identifier of the component, which initiated this event can take the following values:
|
||
report |
Current report object. |
||
fileName |
Report file name for sending and loading to the designer. |
You can find a detailed description and samples of using in the Calling Designer from the Viewer chapter.