New report

Creating a new empty report #

First choose menu item Report -> New:

report_new

A modal of datasource templates is shown for users to choose. Users can either double click or select and click copy any template:

datasource_modal_templates_double_click

datasource_modal_templates_select_copy

The selected template code will be copied to datasource item:

datasource_code_copied

Note: A data source item's code must be a statement that defines a variable called $datasource:

$datasource = ...

If your data source setting is of relational database type, there needs to be a SQL query as well to retrieve data from the sourced database:

sql_query

If your data source setting is of report-based type, there needs to be a datastore name as well to retrieve data from the sourced report. The name should be formatted as "result_< number >" where < number > is the data result of process < number > of the sourced report:

datastore_name

Edit the code to your likes and click on the item's dropdown menu Preview button to request a retrieved data preview:

datasource_dropdown_preview

A data result is shown in table format:

datasource_preview_result

At any point you can show datasource templates again using its dropdown menu:

datasource_dropdown_show_templates

Users can save current datasource code by clicking dropdown menu Save as:

datasource_dropdown_save_as

A dialog to choose the saved name and place is shown:

datasource_modal_ask_save_as

Later users can show saved datasources with dropdown menu Show saved:

datasource_dropdown_show_saved

A modal of saved datasources is shown:

datasource_modal_saved_items

At the top right corner of a datasource is its meta dropdown menu where users can see a datasource template's documentation and example in the right panel.

Documentation menu:

datasource_meta_dropdown_documentation

Documentation result:

datasource_meta_documentation_result

Example menu:

datasource_meta_dropdown_example

Example result:

datasource_meta_example_result

Add a process #

Once you have successfully got data from a datasource, click on Add Process dropdown menu

datasource_add_process_dropdown

or Add process button at the end of the report to add a new process:

datasource_add_process_button

A modal of process templates is shown for users to choose. Users can either double click or select and click copy any template:

process_modal_templates_double_click

process_modal_templates_select_copy

Note: A process item's code must be a statement that defines a variable called $process:

$process = ...

Each process uses the result data of the last process (or data source) before it and outputs its processed data to the next process or visualization.

Edit the code to your likes and click on the process' dropdown menu Preview button to request a processed data preview:

process_dropdown_preview

A data result is shown in table format:

process_preview_result

At any point you can show process templates again using its dropdown menu:

process_dropdown_show_templates

Users can save current process code by clicking dropdown menu Save as:

process_dropdown_save_as

A dialog to choose the saved name and place is shown:

process_modal_ask_save_as

Later users can show saved processes with dropdown menu Show saved:

process_dropdown_show_saved

A modal of saved processes is shown:

process_modal_saved_items

At the top right corner of a process is its meta dropdown menu where users can see a process template's documentation and example in the right panel.

Documentation menu:

process_meta_dropdown_documentation

Documentation result:

process_meta_documentation_result

Example menu:

process_meta_dropdown_example

Example result:

process_meta_example_result

Add a visualization #

Once you have successfully got data from the data source or a process item, click on Add visualization dropdown menu

process_add_visualization_dropdown

or Add visualization button at the end of the report to add a new process:

process_add_visualization_button

A modal of visualization templates is shown for users to choose. Users can either double click or select and click copy any template:

visualization_modal_templates

Note: A visualization item's code must be a statement that creates a KoolReport widget:

\koolreport\widgets\google\AreaChart::create(...);

All visualization template codes use example static array data. To use the result data of the last process (or data source) before a visualization change its "dataSource" line to:

    "dataSource" => $this->dataStore("result"),

Edit the code to your likes and click on the visualization' dropdown menu Preview button to request a visualization preview:

visualization_dropdown_preview

A visualization result is shown in table or chart format:

visualization_preview_result

At any point you can show visualization templates again using its dropdown menu:

visualization_dropdown_show_templates

Users can save current visualization code by clicking dropdown menu Save as:

visualization_dropdown_save_as

A dialog to choose the saved name and place is shown:

visualization_modal_ask_save_as

Later users can show saved processes with dropdown menu Show saved:

visualization_dropdown_show_saved

A modal of saved visualizations is shown:

visualization_modal_saved_items

At the top right corner of a visualization is its meta dropdown menu where users can see a visualization template's documentation and example in the right panel.

Documentation menu:

visualization_meta_dropdown_documentation

Documentation result:

visualization_meta_documentation_result

Example menu:

visualization_meta_dropdown_example

Example result:

visualization_meta_example_result

Complete report #

Here is a simple report that includes a working data source, a working process, and a working visualization:

complete_report

Get started with KoolReport

KoolReport will help you to construct good php data report by gathering your data from multiple sources, transforming them into valuable insights, and finally visualizing them in stunning charts and graphs.