0

I'm trying to write on some sheet in Excel file that contains some sheets with pivots, the problem is when the file is downloaded to the user all pivots are getting inactive (become text). is there another library in PHP / Laravel that can help me or a PHP build-in function to put data on specific sheets without losing the pivots?

Here is my PHP code:

$inputFileName = tempnam(sys_get_temp_dir(), 'xlsx');
    file_put_contents($inputFileName, $file);

    $spreadsheet = IOFactory::load($inputFileName);
    foreach ($data as $value) { 
       //here I'm  put data on some sheet
    }
    $writer = new Xlsx($spreadsheet);
    $writer->save('php://output');

And when the Excel file is downloaded all pivots are getting inactive.

Kevin M. Mansour
  • 2,915
  • 6
  • 18
  • 35

0 Answers0