LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-09-2009, 05:53 AM   #1
candela
LQ Newbie
 
Registered: Apr 2006
Posts: 5

Rep: Reputation: 0
fpdf: prblem with multi page table


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
 
Old 12-10-2009, 08:41 AM   #2
SethsdadtheLinuxer
Member
 
Registered: Jun 2007
Posts: 152

Rep: Reputation: 37
I'd use length($row['my_long_text_1']) and a for/unpack loop to control this process manually. A little more work, but control is the key here.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel page table lqu Linux - Kernel 5 10-02-2009 11:55 PM
access paging table memory using another page table via MMU? valpa Linux - Kernel 8 08-26-2008 03:26 PM
Page table walk manually WebBeing Programming 0 08-05-2008 06:50 PM
Mysql table prblem frieza Programming 2 01-29-2008 05:43 PM
[Perl] multi table query dsheller Programming 4 11-03-2005 05:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration