I saw online example that we can easily export sql to excel file.
require_once ‘vendor/autoload.php’;
require_once ‘config.php’;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
But in dolibarr, have no using composer, so there have no vendor folder.
I try to clone from \core\modules\export\export_excel2007.modules.php
with below code, but it is not working
require_once DOL_DOCUMENT_ROOT.’/core/modules/export/modules_export.php’;
require_once DOL_DOCUMENT_ROOT.’/core/lib/date.lib.php’;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
Any suggestion how to get Spreadsheet namespace?
Thanks.