Título no excel JAVA

2 respostas
fabricioempresa

Seguinte eu tenho uma jtable criado e que exporta os dados para o excel normalmente.

So que eu gostaria que quando ele exportasse ele tivesse em cima dos dados um título (string) que não esta dentro dos dados do meu
jtable.

Alguem sabe como fazer isso?

2 Respostas

Diego_Marinho

Cara, vê se isso te ajuda.

se vc estiver usando uma API chamada Apache POI, tenta desse jeito:

HSSFWorkbook wb          = new HSSFWorkbook();

FileOutputStream fileOut = new FileOutputStream(workbook.xls);

wb.write(fileOut);

fileOut.close();
HSSFSheet sheet = wb.createSheet();

HSSFRow row     = sheet.createRow((short)0);

HSSFCell cell   = row.createCell((short)0);

cell.setCellValue(1);

row.createCell((short)1).setCellValue(1.2);

row.createCell((short)2).setCellValue(This is a string);

row.createCell((short)3).setCellValue(true);

ou entao consulta:
http://onjava.com/pub/a/onjava/2003/04/16/poi_excel.html

[]'s.

fabricioempresa

Bah eu nao estou usando essa api ai nao eu uso jexcelapi que nao eh la mtu boa huauhauhauha

olhei o link mas como eh != a bilbioteca nao deu ai vlw

Criado 9 de abril de 2010
Ultima resposta 9 de abr. de 2010
Respostas 2
Participantes 2