Reports can pull data from SQL databases, with the connection handled on the server through the onBeginProcessData event.

Preparing the data. Read or create the data source, register it in the report dictionary, synchronize the schema, and render with the supplied records.
$viewer->onBeginProcessData = function (StiDataEventArgs $args) {
    if ($args->connection == 'MyConnectionName')
        $args->connectionString = 'Server=localhost; Database=northwind; UserId=root; Pwd=;';
    if ($args->dataSource == 'MyDataSource')
        $args->queryString = 'SELECT * FROM MyTable';
};
$viewer->process();


Handling onBeginProcessData on the server keeps database credentials out of the client; you can override the connection string and query for each named connection and data source.

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.