KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Steps to integrate MS SQL with Koolreport #2195

Closed Komuraiah A opened this topic on on Jul 9, 2021 - 7 comments

Komuraiah A commented on Jul 9, 2021

Dear Team, Currently I am using MS SQL as my data source. For that, I have implemented the setup() function code but facing issues like "driver not found" or else "unknown data source".

Cloud you help me with a detailed step by step producer to get connected with MS-SQL.

Komuraiah A commented on Jul 9, 2021

Dear Team, I have followed all the instructions of the previous issues solutions but still, I am facing the issue of "could not find driver". I have installed the drivers of the MS-SQL Server and configured the file php.ini as below.

protected function settings(){

        return array(
            "dataSources"=>array(
                "DB Name"=>array(
                    "connectionString"=>"sqlsvr:host=Host Name;dbname=DB Name",
                    "username"=>"username",
                    "password"=>"password",
                    "charset"=>"utf8"
                )
            )
        );
    
}

My extensions added in php.ini:

extension=php_pdo_sqlsrv_73_ts_x64; extension=php_sqlsrv_73_ts_x64

extension=php_pdo_sqlsrv_73_nts_x64; extension=php_sqlsrv_73_nts_x64

I have tried with both the extensions but still no use. Please help me

Komuraiah A commented on Jul 9, 2021

Dear Team, Please help me to connect with MS-SQL database

Sebastian Morales commented on Jul 9, 2021

I forget that PHP on Windows is most likely a 32-bit version, thus you would need the x86 drivers instead of x64. Please try this in php.ini:

 extension=php_sqlsrv_73_ts_x86.dll
 extension=php_pdo_sqlsrv_73_ts_x86.dll

Also remember to download those dll files to your ...\php\ext directory (e.g: C:\xampp\php\ext).

To check its success, pls open a phpinfo() page to see info like this:

KoolReport commented on Jul 9, 2021

Here is a post from stackoverview, hope that it helps PDO sqlsrv: could not find driver

Komuraiah A commented on Jul 10, 2021

Dear Team, As per your instruction I have successfully installed and configured the drivers. Able to establish the connection with MS-SQL but still facing small issues as below.

Fatal error: Maximum execution time of 30 seconds exceeded in D:\xampp\htdocs\My project Folder Name\reports\vendor\koolreport_pro-5.7.0\koolreport\core\src\datasources\PdoDataSource.php on line 489

Sebastian Morales commented on Jul 12, 2021

The timeout error could be because your query returned a too large data which caused PHP to not be able to process it in its default max 30 seconds. Pls try to use a very simple query to see whether your connection works first. If it works you could try to optimize your complex query or increase your PHP time out (max_execution_time in php.ini). Tks,

Komuraiah A commented on Jul 12, 2021

Dear Team, Thanks for the support and help. As per your instructions I have executed my task.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

None