Skip to content
  • @vuthao Bổ sung thêm một số phần:

    $content = str_replace('class_exists(\'PHPExcel\')', 'class_exists(\'\PhpOffice\PhpSpreadsheet\Spreadsheet\')', $content);
    $content = str_replace('PHPExcel_Settings::', '\PhpOffice\PhpSpreadsheet\Settings::', $content);
    $content = str_replace('new PHPExcel()', 'new \PhpOffice\PhpSpreadsheet\Spreadsheet()', $content);
    $content = str_replace('PHPExcel_Cell::', '\PhpOffice\PhpSpreadsheet\Cell::', $content);
    
    $content = str_replace('\PhpOffice\PhpSpreadsheet\Settings::setPdfRenderer(', '\PhpOffice\PhpSpreadsheet\Settings::setPdfRendererName(', $content);
    $content = str_replace('\PhpOffice\PhpSpreadsheet\Settings::setPdfRenderer (', '\PhpOffice\PhpSpreadsheet\Settings::setPdfRendererName(', $content);
  • @vuthao anh sửa xíu cái này nhé

    $content = str_replace('PHPExcel\Shared\Date', '\PhpOffice\PhpSpreadsheet\Shared\Date', $content);

    Thành

    $content = str_replace('\PHPExcel\Shared\Date', '\PhpOffice\PhpSpreadsheet\Shared\Date', $content);
    $content = str_replace('PHPExcel\Shared\Date', '\PhpOffice\PhpSpreadsheet\Shared\Date', $content);

    Cái hiện tại trong trường hợp viết \PHPExcel\Shared\Date dẫn đến thừa dấu \ làm site không chạy được

    Anh bổ sung thêm:

    $content = str_replace('PhpSpreadsheet\Shared\Date::ExcelToPHP', 'PhpSpreadsheet\Shared\Date::excelToTimestamp', $content);

    Do hàm ExcelToPHP không còn trên PhpSpreadsheet

  • @dungpt thank

  • Do PhpSpreadsheet quy định cột bắt đầu bằng 1, chứ ko phải bằng ko nữa nên phải sửa lại tất cả code có liên quan đến chỗ số cột tăng thêm 1 đơn vị

    $col = PHPExcel_Cell::stringFromColumnIndex(0); Phải sửa lại thành: $col = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::stringFromColumnIndex(1);

0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment