KoolReport's Forum

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

SQL connection issue in datasource #3312

Open Giri Rajan opened this topic on on Jun 24 - 3 comments

Giri Rajan commented on Jun 24

Hi Team,

    I have use Sqlsrv connection in data source but following issues are occur. Please check and let me know the solution.Thanks

PDOException: SQLSTATE[IMSSP]: An invalid encoding was specified for SQLSRV_ATTR_ENCODING. in file /var/www/html/himes_reports/vendor/koolreport/core/src/datasources/PdoDataSource.php on line 547

#0 /var/www/html/himes_reports/vendor/koolreport/core/src/datasources/PdoDataSource.php(547): PDO->setAttribute() #1 /var/www/html/himes_reports/vendor/koolreport/core/src/core/DataSource.php(108): koolreport\datasources\PdoDataSource->start() #2 /var/www/html/himes_reports/vendor/koolreport/core/src/core/Node.php(365): koolreport\core\DataSource->requestDataSending() #3 /var/www/html/himes_reports/vendor/koolreport/core/src/core/Widget.php(522): koolreport\core\Node->requestDataSending() #4 /var/www/html/himes_reports/vendor/koolreport/core/src/core/Widget.php(541): koolreport\core\Widget->standardizeDataSource() #5 /var/www/html/himes_reports/vendor/koolreport/core/src/widgets/google/Chart.php(69): koolreport\core\Widget->useDataSource() #6 /var/www/html/himes_reports/vendor/koolreport/core/src/core/Widget.php(157): koolreport\widgets\google\Chart->onInit() #7 /var/www/html/himes_reports/vendor/koolreport/core/src/core/Widget.php(760): koolreport\core\Widget->__construct() #8 /var/www/html/himes_reports/app/Reports/Drilldown/BillReport.view.php(27): koolreport\core\Widget::create()

Sebastian Morales commented on Jun 27

Pls either remove the 'encoding' value in your datasource setting or set it to an accepted value, such as:

    'encoding'  => PDO::SQLSRV_ENCODING_UTF8
Giri Rajan commented on Jun 27

Hi Team, Thanks for Reply

I am using data source like this below

        "dataSources"=>array(
            "automaker"=>array(
                "connectionString"=>"sqlsrv:server=10.10.1.254;Database=HIMES_Qusais",
                "username"=>"sa",
                "password"=>"Intuit@321",
                "encoding"  => PDO::SQLSRV_ENCODING_UTF8                   
            ),
        )

same issue occur while adding encoding part.Please check below

SQLSTATE[IMSSP]: An invalid encoding was specified for SQLSRV_ATTR_ENCODING.

Sebastian Morales commented on Jun 27

Depending on your SQL Server version, it does not always support PDO::SQLSRV_ENCODING_UTF8 value. I would suggest remove the 'encoding' to see if it works or, if you must, use an accepted encoding value for your SQL Server version.

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
None yet

None