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.
Setting the spreadsheet's print options - PHP Tutorial
From the course: PHP: Exporting Data to Files
Setting the spreadsheet's print options
The code we've created so far, handles the metadata and defaults for the Excel spreadsheet. Before moving on, I just want to tidy up this code here. Tidy code is always much easier to read. We're now going to turn our attention to how the spreadsheet will look when it's printed. Php Excel is capable of creating Excel workbooks that contain multiple spreadsheets, so we need to begin by specifying which spreadsheet we're working on. So let's add a new line at the end of the tri-block. And we need our sheet object, and we need to set the active sheet index, that's exactly what the method is called. Sheets are regarded as being an array, PHP arrays always begin at zero so the first page will be zero. And most of the remaining code needs to be a reference to the active sheet. So rather than getting the active sheet every time, we can store it in a variable. So, we'll create a variable called active sheet. And then use our sheet object, to get the active sheet. To set the orientation of the…
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)
-
-
-
-
-