-2

I have excel export function in my report. It was working fine in my local server. But, export function was not working in my live server.

It shown error like

Class 'ZipArchive' not found in /libraries/koolreport/packages/excel/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php

Anyone can help me to find the solution for that. Thanks!

EzLo
  • 13,780
  • 10
  • 33
  • 38

2 Answers2

2

The Zip library is required for ZipArchive to work. You have to install the php extension. If you're on Ubuntu or Debian, you can install the php-zip package. Restart your webserver afterwards.

JensV
  • 3,997
  • 2
  • 19
  • 43
-4

First of all, you must locate your third party classes in "vendor" directory on root path. For example;

  • application
  • system
  • vendor
  • index.php

You can do this easily with composer. If composer not installed on your system, you can download it on getcomposer.org

  • In the terminal go to your project root folder
  • Type "composer require phpoffice/phpspreadsheet"

The composer will automatically download it and create vendor path.

Now, you must create a custom library class with name is "Excel" in "application/library" path.

Excel file content is here.

You can use it now in your controller file.

Controller file content is here.

Onur KAYA
  • 234
  • 1
  • 9