0

Dear All,
I am using fpdf to generate a report but one of the field I need to be multicell as the contents can be few lines long. Below is the codes what happens now is that the multicell will be few lines long but the rest of it will be only one standard size and the content after multicell will be on the next line. So how to overcome all this problem.

$row_height = 5; // set the default             
$column_width = 15;

$number_of_lines = ceil( $pdf->GetStringWidth($eventMessage) / ($column_width - 1) );
$cell_height = 5; 
$height_of_cell = ceil( $number_of_lines * $cell_height ); 
if ( $cell_height > $row_height ) {
 $row_height = $cell_height;
}  

$pdf->Cell( 10, $row_height,$count, 1, 0, 'L', true );
$pdf->Cell( 15, $row_height,$row['latitude'], 1, 0, 'L', true );
$pdf->Cell( 16, $row_height,$row['longitude'], 1, 0, 'L', true );
$pdf->Cell( 25, $row_height,$row['dateTimer'], 1, 0, 'L', true );
$pdf->Cell( 25, $row_height,$row['insertDateTime'], 1, 0, 'L', true );

$pdf->MultiCell( 15, $row_height,$eventMessage, 1, 'J',true);
$pdf->Cell( 15, $row_height,$eventSource, 1, 0, 'L', true );
$pdf->Cell( 15, $row_height,$eventLocation, 1, 0, 'L', true );
$pdf->Cell( 18, $row_height,$row['stat'], 1, 0, 'L', true );
2
Contributors
4
Replies
6
Views
5 Years
Discussion Span
Last Post by newbie14
0

According to the example/tutorial you should reset the column after using MultiCell. See tutorial 4 for code.

0

Dear Pritaeas,
I have seen is this what you want me to follow? So what must I change to accommodate this?

function SetCol($col)
{
    // Set position at a given column
    $this->col = $col;
    $x = 10+$col*65;
    $this->SetLeftMargin($x);
    $this->SetX($x);
}
0

Dear Pritaeas,
I think you are referring the to the setXY right but what value to put and how to adjust dynamically is where my problem.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.