Arbeitsblätter zu neuer Excel Datei in PHP hinzufügen

Arbeitsblätter zu neuer Excel-Datei hinzufügen

Arbeitsblätter zu neuer Excel-Datei hinzufügen

PHP-Code

         $dataDir = '';

        // Create Aspose.Cells Helper Object

        $ptr = new \COM('Aspose.Cells.Interop.InteropHelper');

        // Opening through Path

        // Creating a Workbook object and opening an Excel file using its file path

        $workbook = $ptr->New("Aspose.Cells.Workbook",array());

        $worksheets = $ptr->Get($workbook,"Worksheets",array());

        $worksheet_index = $ptr->Call($worksheets,"Add_2",array());

        $worksheet = $ptr->Get($worksheets,"Item",array($worksheet_index));

        $ptr->Set($worksheet,"Name","My Worksheet",array());

        $ptr->Call($workbook,"Save",array($dataDir."/output.xls"));

        print "Completed." . PHP_EOL;

Laufenden Code herunterladen

Arbeitsblätter zu neuer Excel-Datei hinzufügen (Aspose.Cells) von einer der unten genannten sozialen Coding-Websites herunterladen: