From the course: PHP: Exporting Data to Files
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Creating columns and headers in Fusonic SpreadsheetExport - PHP Tutorial
From the course: PHP: Exporting Data to Files
Creating columns and headers in Fusonic SpreadsheetExport
This is cars_open.php, which you can find in the exercise files for this video. Fusonic Spreadsheet Export uses namespaces, so the code on lines two to five includes the PSR4 auto-loader, and registers the Fusonic namespace as described in chapter one. Lines seven to 11 import the classes we'll be needing. There are five altogether. The first one is for the spreadsheet. Then three for different types of column. And the last one is the writer that creates the download file. The rest of the page is the same as in previous exercises. It queries a database to get details of used cars, and displays them in the web page which has a button at the bottom to generate a download file. Line 13 includes the database query and the custom get row function that was defined in chapter one. The version I'm using is for MySQL Improved. If you're using SQLite, or a different database, change MySQLI to PDO. Also make sure that you've got installed the class definitions in the SRC folder Foundation.php…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Introducing PHPExcel3m 31s
-
(Locked)
Setting properties and defaults in PHPExcel6m 58s
-
(Locked)
Setting the spreadsheet's print options5m 59s
-
(Locked)
Populating an Excel spreadsheet with data7m 46s
-
(Locked)
Formatting columns in PHPExcel5m 47s
-
(Locked)
Downloading the data as a .xlsx file5m 18s
-
(Locked)
Creating a spreadsheet in the OpenDocument format3m 4s
-
(Locked)
Creating columns and headers in Fusonic SpreadsheetExport6m 26s
-
(Locked)
Adding the data and downloading as a .ods file6m 52s
-
(Locked)
-
-
-
-
-