Changing an Export Settings on the Server-Side

Export settings can be adjusted on the server when the user exports from the viewer, through the onBeginExportReport event.

Changing Report Properties on the Server-Side

A report's template is JSON, so you can modify its properties on the server before rendering.

Changing the Viewer Theme

The viewer supports many themes and appearance options, set on the PHP options object. This example applies a dark theme and tunes the toolbar.

Configuring and Installing NodeJs

The server-side engine relies on Node.js, which the SDK can install for you. This example installs Node.js and updates the required packages.

Creating a Custom Button on the Viewer Toolbar

Set up the report viewer in PHP, load a template, and connect the component to the application.

Editing a Report Template in the Designer

The Reports.PHP designer runs in the browser, served by the PHP SDK. This example opens the designer with a template loaded for editing.

Editing a Report Template in the Designer in an HTML template

As with the viewer, the designer's scripts and body can be emitted separately to fit your own HTML layout.

Editing a Report Template in the Designer using JavaScript

The designer can be created entirely in JavaScript, with PHP acting only as the request handler. This example uses StiHandler on the server.

Exporting a Report from Code

A report can be exported from PHP code to several formats. This example renders a report and exposes buttons that export it to PDF, Excel or HTML.

Exporting a Report from Code on the Server-Side

Server-side rendering can be followed by a server-side export. This example renders a report with the Node.js engine and exports it to text.

Exporting a Report from Code with Changing Export Settings

Server-side exports can be fine-tuned with a settings object. This example exports to PDF with custom metadata and saves it to a file.

How to Activate the Product

By default Reports.PHP runs in trial mode (with a watermark). This example shows the several ways to apply your license key to remove it.

Loading Scripts in Part to Minify Project

Load the report template in PHP and pass it to the next viewing, rendering, or export operation.

Localizing the Designer

The designer interface can be shown in different languages, and several localization files can be offered at once.

Opening the Report in the Viewer and Changing it on the Server-Side

Handle onOpenedReport in the PHP viewer to modify a report before it reaches the browser.

Printing a Report from Code

A report can be rendered and sent to print directly from PHP code. This example loads a report, renders it, and prints it.

Registering a Data from Code

Data can be registered for the report from code just before it renders, using the onBeforeRender event that runs on the client.

Registering a Data from Code when Rendering a Report on the Server-Side

When rendering server-side, data can be registered through the onBeforeRender event, which runs in the Node.js engine.

Registering Data when Creating a New Report

When a user creates a new report in the designer, you can automatically register data for it through the onCreateReport event.

Rendering a Report from Code

Use PHP code to render a report from code, with the required setup kept alongside the main API calls.

Rendering a Report from Code on a Button Click

Rendering can be deferred until the user clicks a button, rather than on page load. This example outputs the report scripts on demand.

Rendering a Report from Code on the Server-Side

Reports.PHP can render reports fully on the server using an embedded Node.js engine, with no browser involved.

Rendering a Report with SQL from Code on the Server-Side

Prepare the data in PHP, register it in the report dictionary, and render the template with those records.

Saving a Report Template on the Server-Side

When the user saves in the designer, the template is sent to the server where you decide how to store it.

Sending a Report by Email

Create the document in memory in PHP and send it as an e-mail attachment without leaving a temporary file.

Sending an Exported Report to the Server-Side

When the user exports a report, the result can be sent back to the server and saved.

Setting Report Variables on the Server-Side

Load the report template in PHP, assign its variables from application code, and continue with rendering.

Showing a Report in the Viewer

The Reports.PHP viewer is created on the server with the PHP SDK, which outputs the JavaScript viewer into the page.

Showing a Report in the Viewer in an HTML template

When you build the page yourself, you can output the viewer's scripts and body separately so they fit your HTML layout.

Showing a Report in the Viewer in an HTML template using PHP variables

Instead of printing directly, the viewer's HTML can be captured into PHP variables and echoed wherever you need — handy for templating engines.

Showing a Report in the Viewer using JavaScript

You can also build the viewer with plain JavaScript on the client and use PHP only as the data/request handler.

Using Parameters in SQL Query

SQL queries can use parameters whose values you set on the server. This example supplies a parameter value in the onBeginProcessData event.

Using SQL Data Sources

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

Working with onDesign and onExit events

The viewer and designer can be combined into one edit-and-preview workflow using their onDesignReport and onExit events.

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.