KoolReport's Forum

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

Laravel: Undefined index: native_type #1122

Closed Cord opened this topic on on Oct 10, 2019 - 5 comments

Cord commented on Oct 10, 2019

Using the base example for laravel I get following exception:

ErrorException (E_NOTICE) Undefined index: native_type

/vendor/koolreport/core/src/datasources/PdoDataSource.php:

$cType = $this->guessType($info["native_type"]);

The issue seems to be caused by columns of type "blob".

The laravel db connection it configured as type "mysql" but looks like koolreport is treating it as a Pdo connection?

KoolReport commented on Oct 10, 2019

Do you mean you use

`driver`=>'mysql'

in the settings?

Cord commented on Oct 11, 2019

following the example I use this code:

    function setup()
    {
        // Let say, you have "sale_database" is defined in Laravel's database settings.
        // Now you can use that database without any futher setitngs.
        $this->src("mysql")
        ->query("SELECT * FROM sale_database")
        ->pipe($this->dataStore("offices"));
    }

in laravel database.php the connection has the mysql driver configured

        'mysql' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),

KoolReport commented on Oct 11, 2019

Could you please try to replace the line in PdoDataSource.php

$cType = $this->guessType($info["native_type"]);

with following

$cType = $this->guessType(Util::get($info, "native_type", "unknown"));

Let me know if it works.

Cord commented on Oct 11, 2019

yes, notice is gone

KoolReport commented on Oct 12, 2019

This fix will be included in next 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
bug
solved

None