-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Description
This is:
- [X] a bug report
- [ ] a feature request
- [X] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
After setting print area starting with a non-A column (e.g. B1:B2), calling setBreak('B1', Worksheet::BREAK_ROW)
should be able to split B1 and B2 in two different pages.
What is the current behavior?
B1 and B2 appears in the same page in print preview.
To have a correct row break for non-A column, min="1" max="(count of print area columns)"
should be added to the <brk>
element in xl/worksheets/*.xml. These two attributes can be referred to the XML standard.
https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oe376/b32ae11b-dee7-4dcb-9b46-a0feb32ce94f
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
<?php
require __DIR__ . '/vendor/autoload.php';
// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
// add code that show the issue here...
$sheet = $spreadsheet->getActiveSheet();
$sheet->setCellValue('B1', 'First Page');
$sheet->setCellValue('B2', 'Second Page');
$sheet->getPageSetup()->setPrintArea('B1:B2');
$sheet->setBreak('B1', \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::BREAK_ROW);
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($spreadsheet);
$writer->save('hello_world.xlsx');
Which versions of PhpSpreadsheet and PHP are affected?
PhpSpreadsheet 1.10.1
PHP 7.2
adjenks
Metadata
Metadata
Assignees
Labels
No labels