0

I'm having trouble saving the file xlsx when the data has function

[E22] = PMT (D20 / 12, D19, -E23, D7.0)

environment:

laravel 5.8

php 7.1

phpoffice/phpspreadsheet [1.7.0] - 2019-05-26

public function gen_file_download_tt(&$result) {

        $language = $this->getlocal();
        $excel_tempate = public_path(). "/excel/template/truyenthong_".$language.".xlsx";
        $ex = new Excel();
        $ex->load($excel_tempate);


        $file_name = 'BangTinh_TruyenThong_Thang_'.Date('YmdHis').'.xlsx';
        $excel_result = public_path(). "/excel/download/".$file_name;
        $ex->save($excel_result);

        $ex->free();
        return $file_name;
    }

excel resource($excel_tempate): https://drive.google.com/file/d/1iJY5_F0TNrVWQfkUxaAVj-XMquYfnMOO/view?usp=sharing

opening up and saving will get the following error: https://drive.google.com/file/d/1FfwjooMKOABZmuDfuCvfoBKUsrTcgFWd/view?usp=sharing

This error is not affected by other normal excel files

Hưng Trịnh
  • 947
  • 1
  • 12
  • 23

1 Answers1

0

I have found the cause of the error here

[E22] = PMT (D20 / 12, D19, -E23, D7.0)

error returned value: #VALUE

so open excel does not save.

Hưng Trịnh
  • 947
  • 1
  • 12
  • 23