For God so loved the world, that He gave His only begotten Son, that all who believe in Him should not perish but have everlasting life
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.3 KiB

  1. # PHPExcel Developer Documentation
  2. ## Creating a spreadsheet
  3. ### The PHPExcel class
  4. The PHPExcel class is the core of PHPExcel. It contains references to the contained worksheets, document security settings and document meta data.
  5. To simplify the PHPExcel concept: the PHPExcel class represents your workbook.
  6. Typically, you will create a workbook in one of two ways, either by loading it from a spreadsheet file, or creating it manually. A third option, though less commonly used, is cloning an existing workbook that has been created using one of the previous two methods.
  7. #### Loading a Workbook from a file
  8. Details of the different spreadsheet formats supported, and the options available to read them into a PHPExcel object are described fully in the PHPExcel User Documentation - Reading Spreadsheet Files document.
  9. ```php
  10. $inputFileName = './sampleData/example1.xls';
  11. /** Load $inputFileName to a PHPExcel Object **/
  12. $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
  13. ```
  14. #### Creating a new workbook
  15. If you want to create a new workbook, rather than load one from file, then you simply need to instantiate it as a new PHPExcel object.
  16. ```php
  17. /** Create a new PHPExcel Object **/
  18. $objPHPExcel = new PHPExcel();
  19. ```
  20. A new workbook will always be created with a single worksheet.