Steps and parsing for exporting files using Phpexcel:
Create a new Excel table: Instantiate the Phpexcel class
Create a sheet (built-in table): Createsheet () method to create a new sheet method
The Setactivesheetindex method is to set sheet as the current active table
Getactivesheet method to get the active object of the current sheet
Fill Data Setcellvalue () method
Save File Phpexcel_iofactory::createwrite () method
Save () method
New document.php File
Find the path where the current script file is located $dir =dirname (__file__);
Introduce file require $dir. " Phpexcel/phpexcel.php "; In a sibling directory
Instantiate the Phpexcel class $objPHPExcel =new phpexcel (); is equivalent to creating a new Excel table on the desktop
Gets the current active sheet setting Name: $objSheet = $objPHPSheet->getactivesheet ();
Sets the name $objSheet->settitle ("name") for the current active sheet.
Fills the current activity sheet data $objSheet->setcellvalue ("A1", "name")->setcellvalue ("", ""); the cell location where the data is populated
Or the form of an array:
$array =array (
Array (),
Array ("", ""),
);
Generates Excel files in the specified format phpexcel_iofactory::createwriter ($objPHPExcel, "Excel20007");
Export files using Phpexcel