Defect #1963
function addPageBreak() - not working
0%
Description
Based from the code the method addPageBreak() adds a Page Break in the table.
But it isn't working right now. The defined array $aData is not used and insertNewPage and addRow are disabled:
/**
* Adds a Page Break in the table.
*/
public function addPageBreak()
{
//$this->insertNewPage();
$aData = [];
$aData['ADD_PAGE_BREAK'] = true;
$this->dataCache[] = array(
'HEIGHT' => 0,
'DATATYPE' => self::TB_DATA_TYPE_INSERT_NEW_PAGE
);
// $this->addRow($aData);
}
Based from my understanding of the code the wrong constant is used within the code and it will work if you replace
'DATATYPE' => self::TB_DATA_TYPE_INSERT_NEW_PAGE
into
'DATATYPE' => self::TB_DATA_TYPE_NEW_PAGE
Because constant ...NEW_PAGE resolves to "new_page" which is used as a string in line 1495 and 1547.
Maybe you can check those lines and replace the string against the right constant.
I'm using newest release 6.1.0 and talking about table.php
Or am I wrongly using this method? Maybe you can guide me in this case...
Best wishes
Files
Updated by Andrei Bintintan over 3 years ago
- File doc (1).pdf doc (1).pdf added
- File example-table-dev1.php example-table-dev1.php added
- Status changed from In Progress to Feedback
- Assignee changed from Andrei Bintintan to Timo Kempkens
Hi Timo,
Indeed that function needs a clean-up. But the page brake seems to be working.
Can you provide me an example?
The page-brake is added in $this->dataCache[]
which is correct.
Have a look at the attached example if it's working on your side.