-
Create Excel Files With Text Aligned Horizontally In PHP Using PHPSpreadSheet
Set the horizontal alignment of a cell data by coding it’s styling position to the left, to the right, or in the center, these can all be done with the PhpSpreadsheet setHorizontal() function. Requirements: Composer PHP 7.2 or newer Step 1. Setup dependencies. { “require”: { “phpoffice/phpspreadsheet”: “^1.3” } } composer.json Step 2. Install phpspreadsheet. […]
-
Create Excel Files Specifying The Printing Area In PHP Using PHPSpreadSheet
Define print area when creating xlsx file in PhpSpreadsheet by setting specific cell row and column, this will give control in which particular part of the spreadsheet should only be printed. Requirements: Composer PHP 7.2 or newer Step 1. Setup dependencies. { “require”: { “phpoffice/phpspreadsheet”: “^1.3” } } composer.json Step 2. Install phpspreadsheet. $ composer […]
-
Create Excel Files With Rows And Columns Repeat Settings In PHP Using PHPSpreadSheet
To save some time coding same cell value/s for each page of a spreadsheet, use the function setRowsToRepeatAtTopByStartAndEnd() when creating xlsx file in PhpSpreadsheet to repeat row/s on every printed page. To clearly demostrate the result of this tutorial, the Setting Printing Breaks in PhpSpreadsheet Tutorial will be used. Requirements: Composer PHP 7.2 or newer […]
-
Create Excel Files With Option To Hide The Gridlines In PHP Using PHPSpreadSheet
Gridlines on xlsx files help users easily distinguish cells from one another, acting as guides to tell apart between columns and rows. However, for any specific reason, or no reason at all, there is an option to hide gridlines. This spreadsheet tutorial will show how to do that in PhpSpreadsheet. Requirements: Composer PHP 7.2 or […]
-
Create Excel Files With Printing Breaks Settings In PHP Using PHPSpreadSheet
To make sure the contents of the xlsx file is on it’s intended page, the function setBreak() can be used when coding with PhpSpreadsheet. This will make sure the data will start on which page it is set to begin with, leaving no doubt that the xlsx file generated will be printed correctly. Requirements: Composer […]
-
Create Excel Files With Header And Footer In PHP Using PHPSpreadSheet
With the simple setOddHeader() and setOddFooter() functions in PhpSpreadsheet, set a detailed document information at the top and at the bottom respectively. Short information such as the name of the document, company name, document title, page number data, or any other key specifics needed can be added. Some of the basic font design styles can […]
-
Create Excel Files With Center On Page Settings In PHP Using PHPSpreadSheet
At times, when creating an xlsx file, there is a need to put the data in center or in the middle of the page. This can be achieved by the use of Center on page options under the page setup. With PhpSpreadsheet, there is the function setHorizontalCentered() for centering horizontally, and the function setVerticalCentered() for […]
-
Create Excel Files With Page Margins Settings In PHP Using PHPSpreadSheet
Before printing an xlsx file, there are options to align it’s worksheet to make it look finer when printed. These are the adjustments on the white spaces at the top, bottom, left, and right sides of the document, these are commonly known as page margins. Requirements: Composer PHP 7.2 or newer Step 1. Setup dependencies. […]
-
Create Excel Files With Page Orientation And Paper Size Settings In PHP Using PHPSpreadSheet
When printing xlsx files, there are two (2) options of page orientation (the manner in which the paper will be printed), they are the portrait (vertically positioned page), and the landscape (horizontallly positioned page). The portrait option is the default setting when creating an xlsx file, but it can be programmatically changed with PhpSpreadsheet. Another […]