Yii Pdf Generator

I want to generate a pdf file using tcpdf plugin, when i try to generate a pdf file having more than 5 columns(table fields from model) then it shows an error in "MYPDF.php" file…

the notice is " Undefined offset: 4 "…

i tried alot to solve this problem…bt i didnt get a proper solution…

dear friends would you please give me a solution for this as soon as possible

HI,

Can you give as some details. like picture or error that you are facing.

many thanks.

yaaaa sure

i got error at this function " ColoredTable"

public function ColoredTable($header,$data) {

	// Colors, line width and bold font


	$this->SetFillColor(255, 0, 0);


	$this->SetTextColor(255);


	$this->SetDrawColor(128, 0, 0);


	$this->SetLineWidth(0.3);


	$this->SetFont('', 'B');


	// Header


	$w = array(30, 30, 30, 30);


	$num_headers = count($header);


	for($i = 0; $i < $num_headers; ++$i) {


    	$this->Cell($w[$i], 7, $header[$i], 1, 0, 'C', 1); // got  error at this line.....error is Undefined offset: 4


	}


	$this->Ln();


	// Color and font restoration


	$this->SetFillColor(224, 235, 255);


	$this->SetTextColor(0);


	$this->SetFont('');


	// Data


	$fill = 0;


	foreach($data as $row) {


    	$this->Cell($w[0], 6, $row[0], 'LR', 0, 'L', $fill);


    	$this->Cell($w[1], 6, $row[1], 'LR', 0, 'L', $fill);


    	


 	      	


    	$this->Cell($w[2], 6, $row[2], 'LR', 0, 'L', $fill);


		$this->Cell($w[3], 6, $row[3], 'LR', 0, 'L', $fill);  // got  error at this line.....





    	


    	


    	$this->Ln();


    	$fill=!$fill;


	}


	$this->Cell(array_sum($w), 0, '', 'T');


}

please help me to solve this error…