… POR EXEMPLO:
$table = $section->addTable(‘myTable2’);
$table->addRow(50);
$table->addCell(8000)->addText(‘Nome’, $fontStyle, $paraStyle);
$table->addCell(3000)->addText(‘Data Nasc.’, $fontStyle, $paraStyle);
$table->addCell(2000)->addText(‘Idade’, $fontStyle, $paraStyle);
$table->addCell(2000)->addText(‘Parantesco’, $fontStyle, $paraStyle);
$table->addCell(2000)->addText(‘Rendimentos’, $fontStyle, $paraStyle);
//$table->addCell(2000)->addText(‘NIF’, $fontStyle, $paraStyle);
$check_produtos = “SELECT nome,datanasc,idade,grauparantesco,rendimentos "
. ’ FROM mobilidade_agregados’
. " WHERE registo = '”.$xwnumero."’ ORDER BY NOME";
sc_select(it001, $check_produtos);
if ({it001} === false){
sc_error_message(‘Erro ao Acessar a Base de Dados.’);
}else{
while (!$it001->EOF){
$table->addRow(50);
$table->addCell(2000)->addText( $it001->fields[0]);
$table->addCell(2000)->addText( $it001->fields[1]);
$table->addCell(2000)->addText( $it001->fields[2]);
$table->addCell(2000)->addText( $it001->fields[3]);
$table->addCell(2000)->addText( $it001->fields[4]);
// $table->addCell(2000)->addText( $it001->fields[5]);
$it001->MoveNext();
}
$it001->Close();
}
o resultado no word é este: