Hello,
i'm developing a web aplication and i'have to build a pdf report, my problem is that i have the first and the last cells of every row that are text rows of different length, so i've to use
multicell to write them, but i'm becoming crazy when one of those cells is partially in a page, and then finished on the next one....
i loop my array of data using single row array:
$row
i have an array of column width:
$w
i have an array that verify current page and coordinate (y):
$settingCurrent
PHP Code:
$this->SetFont('Arial','B',12);
// position first cell
$this->page=$settingCurrent['page'];
$this->SetXY(10, $settingCurrent['y']);
$msg=$row['my_long_text_1'];
$this->multicell($w[0],10,$msg,$border,$align,$fill);
// verify where the cursor arrived, and how hight was the first cell
$settingTemp=$this->next_setting($settingTemp);
$cur_h=$this->last_h($settingCurrent);
// position second cell $this->page=$settingCurrent['page'];
$this->SetXY(150, $settingCurrent['y']);
$msg=$row['my_long_text_2'];
$this->multicell($w[1],$cur_h,$msg,$border,$align,$fill);
$settingTemp=$this->next_setting($settingTemp);
where
$settingCurrent is an array where i set two variable:
page: to indicate the page where the row start
y: the y where the row start
$settingTemp has the same setting, but they are set to final higer value (of page and/or y),
so at the and of the row i set $settingCurrent=$settingTemp
everitings works fine, but if the first cells goes partially to the next page, it seems like it has been cancelled in the moment i set my page back to the value i've started to write the row.
I mean: if a single row start on a page, and ends on the next one, i only see the last column (the last cell of the row!)
any idea!?
thanks