Reportico Customization

Creating a custom script

Reportico runs via the script run.php in the main Reportico folder. Within this script there are many default options which can be altered to alter the behaviour and the default look and feel of reportico. For example you can change whether Reportico uses bootstrap styling, or hide some of the user interface controls. Looking through this script will give you an idea of the configurable options.

But most importantly you can copy this script to another customised version in order to run Reportico in a variety of ways.

So you can create a custom Reportico script which, when called, runs a Report project menu directly without having to go through the Admin pane. Or you can create a script to run a single report.

For example, on the previous example page we created a report called stockreport in the project northwind.

If you wanted to create a custom script to run just that report in criteria entry mode you can copy the run.php to, for example stockreport.php and set the following parameters found in this file :-

        $q->initial_project = "northwind";   // Loads northwinf project
        $q->initial_report = "stockreport";  // Loads stockreport.xml report
        $q->access_mode = "ONEREPORT";       // Allows access to only the report, with no access to admin or project menu
        $q->execute_mode = "PREPARE";        // Starts in report criteria entry mode .. "EXECUTE" would generate output instead
        $q->clear_reportico_session = true;  // Will restart the session on refresh otherwise will just continue from where user left off
                                             // You usually want to set this when creating custom scripts

        // other options
        $q->output_template_parameters["show_hide_prepare_section_boxes"] = "hide"; // hides the output section checkboces in the report options
        $q->output_template_parameters["show_hide_prepare_csv_button"] = "hide"; // hides the CSV output button
        $q->output_template_parameters["show_hide_prepare_page_style"] = "hide"; // Hides the Form / Table option in the report options
Read the contents of the run.php script for all the options or see the Reportico Embedding Documentation for more details.

Note that you also create a custom script in another folder as long as the you fully the path inclusion of Reportico by changing

   require_once('reportico.php');
to
   require_once('/path/to/reportico.php');

Change the look and feel of reportico

There are two ways of changing the overall styling of reportico :-

1. HTML reports can be changed by changing the CSS files

The overall styling of report output, and criteria entry is customisable by editing the CSS scripts used by Reportico. You will find these under the Reportico folder named css. If you are using Reportico in Bootstrap mode then look in reportico_boostrap.css otherwise look in reportico.css. In here you will be able to change styles for report rows, group headers, column headers, criteria selection boxes etc. You could use a web browser debugging tool to find the appropriate style classes to change. For example you can change the colour of the odd and even rows in report output by modifying the style for swReportLine:-
.swRepResultLine:nth-child(even) { background-color: #eeeeee; }
.swRepResultLine:nth-child(odd) { background-color: #ffffff; }

2. HTML and PDF can be programmatically customized via the reportico_defaults.php file

From version 4.3 the file reportico_defaults.php can be modified to apply styles, images, headers and footers globally to all reports in the system or by project.

See the Reportico documentation on default styles

Embedding Reportico >>