Hi, I want to create an API to processing data from "importing data from excel koolreport" into data array. I have used koolreport pro. what I want to ask:
Can koolreport read more than 2 sheets in 1 excel file? if so what method should be used?
how to retrieve/get data after pipe->datastore() to make it an array?
this is my script
require ROOT_PATH.'\gsapi\vendor\autoload.php';
use \koolreport\excel\ExcelDataSource;
class tes extends \koolreport\KoolReport{
public $cls;
public function settings()
{
return array(
"dataSources"=>array(
"read_excel"=>array(
"class"=>ExcelDataSource::class,
"filePath"=>dirname(__FILE__)."\\"."temp\FF CTP DELTA 08W21 - OUT PORT.xls",
"sheetIndex"=>2,
)
)
);
}
public function setup()
{
$result = $this->src('read_excel')
->pipe($this->dataStore("tes"));
// $res = $this->dataStore("tes")->all();
}
public function handler(){
$cls = new tes;
$cls->run();
$res = $this->dataStore("tes")->count();
echo var_dump($cls);die;
}
}
$param = file_get_contents("php://input");
$cls_tes = new tes;
$start = $cls_tes->handler();