Project

General

Profile

Defect #1963

function addPageBreak() - not working

Added by Timo Kempkens over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Start date:
12/14/2020
Due date:
% Done:

0%

Estimated time:

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

doc (1).pdf View doc (1).pdf 1.91 KB Andrei Bintintan, 12/15/2020 09:10 AM
example-table-dev1.php example-table-dev1.php 1.67 KB Andrei Bintintan, 12/15/2020 09:10 AM
#1

Updated by Andrei Bintintan over 3 years ago

  • Status changed from New to In Progress
#2

Updated by Andrei Bintintan over 3 years ago

  • Assignee set to Andrei Bintintan
#3

Updated by Andrei Bintintan over 3 years ago

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.

#4

Updated by Andrei Bintintan over 3 years ago

+ping. Any updates?

#5

Updated by Andrei Bintintan about 3 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF