ai esta uma aplicação q esta gerando um arquivo pdf....
eu crie uma tabela como mais ou menos vc quer....
import java.awt.Color;
import java.io.FileOutputStream;
import java.io.IOException;
import com.lowagie.text.Cell;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Font;
import com.lowagie.text.FontFactory;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Table;
import com.lowagie.text.pdf.PdfWriter;
public class pdfTeste {
public static void main(String[] args) {
System.out.println("Gerei o Arquivo PDF");
Document document = new Document();
try {
PdfWriter.getInstance(document, new FileOutputStream("relatório.pdf"));
document.open();
Paragraph par = new Paragraph(new Chunk("Relatório de Horário",FontFactory.getFont(FontFactory.TIMES_ROMAN,18,Font.BOLD)));
par.setAlignment("center");
document.add(par);
Table table = new Table(6,2);
table.setBorderWidth(1);
table.setWidth(100);
table.setBorderColor(new Color(0, 0, 0));
Cell cell = new Cell(new Chunk("Horário de entrada", FontFactory.getFont(FontFactory.TIMES_ROMAN, 14, Font.BOLD, new Color(0, 0, 0))));
cell.setColspan(2);
table.addCell(cell);
cell = new Cell(new Chunk("Horário de Saida", FontFactory.getFont(FontFactory.TIMES_ROMAN, 14, Font.BOLD, new Color(0, 0, 0))));
cell.setColspan(2);
table.addCell(cell);
cell = new Cell(new Chunk("Tempo de Trabalho", FontFactory.getFont(FontFactory.TIMES_ROMAN, 14, Font.BOLD, new Color(0, 0, 0))));
cell.setColspan(2);
table.addCell(cell);
cell = new Cell(new Chunk("16:00", FontFactory.getFont(FontFactory.TIMES_ROMAN, 10, Font.BOLD, new Color(0, 0, 0))));
cell.setColspan(2);
table.addCell(cell);
cell = new Cell(new Chunk("18:00", FontFactory.getFont(FontFactory.TIMES_ROMAN, 10, Font.BOLD, new Color(0, 0, 0))));
cell.setColspan(2);
table.addCell(cell);
cell = new Cell(new Chunk("14400", FontFactory.getFont(FontFactory.TIMES_ROMAN, 10, Font.BOLD, new Color(0, 0, 0))));
cell.setColspan(2);
table.addCell(cell);
document.add(table);
document.add(new Paragraph("Ai esta um artquivo gerado em PDF"));
}
catch(DocumentException de) {
System.err.println(de.getMessage());
}
catch(IOException ioe) {
System.err.println(ioe.getMessage());
}
document.close();
}
}
[/code]