good I am generating a pdf, the question is, when I print the data when using a foreach, at the time it gives the second round as I can assign the new coordinates and so for the q follow for example if there are 50 records, assign them the coordinates.
foreach ($data as $key => $value) {
$pdf->Text(6,45,$data[0]->fecha_registro);
if (strlen($data[$key]->nombre) > 28)
{
$pdf->Sety(25);
$pdf->setx(44);
$pdf->MultiCell(41, 20,trim($data[$key]->nombre));
$pdf->Ln();
}else{
$pdf->Text(25, 45,$data[$key]->nombre);
}
if (strlen($data[$key]->tipo) > 28)
{
$pdf->Sety(44);
$pdf->setx(127);
$pdf->MultiCell(41, 20,trim($data[$key]->tipo));
$pdf->Ln();
}else{
$pdf->Text(127, 44,$data[$key]->tipo);
}
I have that and in my object I have registered 20 people, hence I do not know how to do it so that when I return the foreach and change $ key to 1 give it the coordinates.
When it happens for the first time it fills the data (blue color) as well as in the image, then when I take the second round I want to fill in the next one (red), and logically when I go to the red the coordinates change if the I leave as well as in the first one over everything, my pdf document is a template the table is already predefined from word.