Installation

Smart Report Engine is user-friendly and hassle-free to install. It doesn't necessitate the use of any additional frameworks. Moreover, its code is clean, well-organized, and straightforward. In the following sections, we will provide detailed instructions on how to install Smart Report Engine in both a native PHP project and a Laravel project.

Smart Report Engine supports two convenient methods for its installation in a native PHP application based on your preferences. You can choose to install Smart Report Engine using Composer, a popular dependency management tool for PHP projects. Alternatively, if you prefer not to use Composer, we also provide a manual installation method. Regardless of the method you choose, Smart Report Engine is designed to seamlessly integrate into your workflow and provide you with powerful reporting capabilities.

1- Native Installation


Requirements

Before installing Smart Report Engine, it is important to take note of a few requirements:
  • PHP version 5.6 or later
  • Any version of MYSQL server
  • Apache or any web server

1.1- Installing Smart report engine in a native PHP project using composer


1- Once you have purchased a Smart Report Engine license, you may download the full version of Smart Report Engine.

2- Extract the downloaded full version of Smart Report Engine into a new directory. In the extracted directory, you should find two directories named 'Native' & 'Laravel'. You will use only the 'Native' directory for this installation.

3- Locate the 'Native' directory; inside it you should find three directories, and one file named "sre_bootstrap"

4- Please ignore the "sre_bootstrap" file, and copy the three directories (which you got from the previous step) into the root directory of your project, as shown in the following image.

Responsive image

Adding the engine's directories in a the root directory of a PHP project.

5- Open the"composer.json" file , which should be found in your PHP application's root directory, then please do the following three changes in it using any text editor.

i. Add the following "path" repository
 
							"repositories": [
							    {
							        "type": "path",
							        "url": "SmartReportingEngine"
							    }
							],
							
ii. Include sre/sre to your list of required packages, as follows:
 
							"require": {
							            "sre/sre": "*"
							}
							
iii. Include the configuration file of smart report engine to the list of the autoload files, as follows:
 
							"autoload": {
							             "files": ["sre_config/config.php"]
							}
6- Run the composer update command in your console terminal as follows

								Composer update
7- Run the composer dump-autoload in your console terminal as follows:

								 composer dump-autoload

1.2- Installing Smart Report Engine in a native PHP project without using composer



1- Once you have purchased a Smart Report Engine license, you may download the full version of Smart Report Engine.

2- Extract the downloaded full version of Smart Report Engine into a new directory. In the extracted directory, you should find two directories named 'Native' & 'Laravel'. You will use only the 'Native' directory for this installation.

3- Locate the 'Native' directory; inside it you should find three directories, and one file named "sre_bootstrap"

4- Copy the three directories and the "sre_bootsrap" file (which you got from the previous step) into the root directory of your project, as shown in the following image.

Responsive image

Adding the engine's directories in the root directory of a PHP project.

5- To use Smart Report Engine from anywhere in your app, please make sure to make the following changes in your code:
i. Import the "SRE\Engine\CustomEngine" and the "SRE\Engine\ReportOptions" classes.
ii. Require the "sre_bootstrap.php" file. Click here for a tutorial



2- Laravel Installation


Requirements

Smart Report Engine Laravel Package has a few requirements you should be aware of before installing:
  • Composer
  • Laravel Framework 5.5+
  • PHP version 7.0 or later
  • Any version of MYSQL server
  • Apache or any web server

Installing Smart Report Engine as a laravel Package

1- Once you have purchased a Smart Report Engine license, you may download the full version of Smart Report Engine.

2- Extract the downloaded full version of Smart Report Engine into a new directory. In the extracted directory, you should find two folders named 'Native' & 'Laravel'. You will use only the 'Laravel' directory for this installation.

3- Locate the 'Laravel' folder; inside it you should find a single directory named "sre"

4- Copy the "sre" folder directly into the root directory of your laravel project, as shown in the following image.


Responsive image

Adding the engine's "sre" directory in the root directory of a laravel project.

5- Locate the configuration file of the engine at "Path-to-your-project/sre/SmartReportingEngine/src/Configs.php".

6- Open the configuration file for editing (with any text editor). Then update this configuration file, by adding a default MYSQL connection parameter and a default login page (to be used for private reports).To know more about configuring Smart Report Engine please click here!

7- Locate your "composer.json" file (which you can find in the root directory of your project). Then please open it for editing (using any text editor) to do the following changes.
i. Add the following "path" repository, as follows:
 
					"repositories": [
					   {
					        "type": "path",
					        "url": "sre"
					   }
					],
					

ii. Include sre/sre to your list of required packages as follows:
 
					"require": {
					    "sre/sre": "*"
					}

8- Locate the Laravel's app configuration file, which you can find at: "Path-to-your-project/config/app.php". Then, update this file by including the 'SmartEngineServiceProvider' service provider in the list of providers as follows:
 
					'providers' = [
					    Sre\SmartReportingEngine\src\Providers\SmartEngineServiceProvider::class,
					]
					

9- Run the composer update command in your console terminal as follows:

						Composer update
10- Run the vendor:publish artisan command in your console terminal, as follows:
php artisan vendor:publish --provider="Sre\SmartReportingEngine\src\Providers\SmartEngineServiceProvider"
11- Finally, run the composer dump-autoload in your console terminal as follows:
composer dump-autoload

See also
Configuring Smart Report Engine
Getting started with Smart Report Engine
Report Options
FAQ