Project

General

Profile

Defect #585

Tables spanning several pages starts to break apart...

Added by Joe Privett over 10 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
High
Assignee:
Target version:
-
Start date:
01/15/2014
Due date:
% Done:

0%

Estimated time:

Description

I have generated a PDF (attached) containing a table using the code below. Problem is that after the table crosses a few pages, it starts to break-up - do you know why?

$num_columns = 4;
$table = new tfpdfTable($pdf_report);
$table->initialize(array(70,90,55,55), $table_2_config);

$row = array();
$row[0]['TEXT'] = stripslashes($row_cat['ra_hazard_category']);
$row[0]['TEXT_COLOR'] = array(255,255,255);
$row[0]['TEXT_SIZE'] = 14;
$row[0]['LINE_SIZE'] = 6;
$row[0]['BACKGROUND_COLOR'] = array(53,53,53);
$row[0]['COLSPAN'] = 4;
$table->addRow($row);

$row = array();
$row[0]['TEXT'] = "Hazard";
$row[0]['TEXT_TYPE'] = 'B';
$row[0]['BACKGROUND_COLOR'] = array(241,241,241);
$row[1]['TEXT'] = "Existing Control Measure(s)";
$row[1]['BACKGROUND_COLOR'] = array(241,241,241);
$row[1]['TEXT_TYPE'] = 'B';
$row[2]['TEXT'] = "Category of Harm";
$row[2]['BACKGROUND_COLOR'] = array(241,241,241);
$row[2]['TEXT_TYPE'] = 'B';
$row[3]['TEXT'] = "Likelihood of Harm";
$row[3]['BACKGROUND_COLOR'] = array(241,241,241);
$row[3]['TEXT_TYPE'] = 'B';
$table->addRow($row);

for($h=0;$h <count($haz_title_array);$h++){

$row = array();
$row[0]['TEXT'] = $haz_title_array[$h];
$row[1]['TEXT'] = $ecm_text_array[$h]; 
$row[2]['TEXT'] = $ra_harm_category_array[$h]; 
$row[3]['TEXT'] = $ra_harm_likelihood_title_array[$h]; 
$table->addRow($row);

}

$table->close();


Files

doc.4-21.pdf View doc.4-21.pdf 177 KB Joe Privett, 01/15/2014 02:49 PM
#1

Updated by Andrei Bintintan over 10 years ago

  • Status changed from New to Feedback
  • Assignee changed from Andrei Bintintan to Joe Privett

This usually happens when the page-break is NOT triggered by the table.

  1. Which table version are you using?
  2. Try to disable header/footer functions and see if it's working.

If 2 solves your issue, make sure that your header function is NOT changing the Y value after exit.

If still not ok, let me know, it also might be a bug.

#2

Updated by Joe Privett over 10 years ago

I'm using version 4.0.6 - can I get a free upgrade if there is a newer version?

#3

Updated by Joe Privett over 10 years ago

Where do I disable the header and footer functions?

#4

Updated by Andrei Bintintan over 10 years ago

Joe Privett wrote:

I'm using version 4.0.6 - can I get a free upgrade if there is a newer version?
That version is very old and is not supported anymore. You can get the latest version here: http://www.interpid.eu/download

Where do I disable the header and footer functions?
If you have defined them, look for -> Header() and Footer() function in the main pdf class.

#5

Updated by Andrei Bintintan almost 8 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF