Generar excel
Publicado por enrique (5 intervenciones) el 17/08/2016 17:56:50
hola amigos buenos dias tengo un problema con un excel que genero en una aplicacion web, el problema es que lo tenia y funcionaba pero le quite algunos datos porque asi me lo pidieron y dejo de funcionar
el codigo al que le quite los datos quedo asi
el codigo al que le quite los datos quedo asi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
String sql = ("select convenios.folio, convenios.contra_pa,convenios.desc_ser, convenios.total_civa, convenios.total_siva, convenios.f_ini, convenios.f_conclu, convenios.reg_res, tipo_rec.tipo_recu, coord.nomb_coord,subcoord.nomb_subc,tipo_doc.tipo_doc, nacionalidad.nacionalidad,fianza.fianza from convenios join tipo_rec on tipo_rec.id_recu=convenios.id_recu join coord on coord.id_coord=convenios.id_coord join subcoord on subcoord.id_subc=convenios.id_subc join tipo_doc on tipo_doc.id_tipo_doc=convenios.id_tipo_doc join nacionalidad on nacionalidad.id_nac=convenios.id_nac join fianza on fianza.id_fian=convenios.id_fian where convenios.anhos = "+anhos+"");
try{
PreparedStatement pstm = conn.prepareStatement(sql);
ResultSet res = pstm.executeQuery();
System.out.println( "obteniendo registros.....Listo" );
while(res.next()){
jxl.write.Label ci = new jxl.write.Label(16, row, res.getString("anhos"), cf);
Label folio = new Label(1, row, res.getString("folio") , cf);
Label tipo_rec = new Label (2, row, res.getString("tipo_recu") , cf);
Label nomb_coord = new Label(3, row, res.getString("nomb_coord") , cf);
Label nomb_subc = new Label(4, row, res.getString("nomb_subc") , cf);
Label contra_pa = new Label (5, row, res.getString("contra_pa") , cf);
Label tipo_doc = new Label (6, row, res.getString("tipo_doc") , cf);
Label desc_ser = new Label (7, row, res.getString("desc_ser") , cf);
Label total_civa = new Label (8, row, res.getString("total_civa") , cf);
Label total_siva = new Label (9, row, res.getString("total_siva") , cf);
Label f_ini = new Label (10, row, res.getString("f_ini") , cf);
Label f_conclu = new Label (11, row, res.getString("f_conclu") , cf);
Label reg_res = new Label (12, row, res.getString("reg_res") , cf);
Label nacionalidad = new Label(13, row, res.getString("nacionalidad") , cf);
Label fianza = new Label (14, row, res.getString("fianza") , cf);
Label orig = new Label (15, row, res.getString("orig") , cf);
row++;
try{
excelSheet.addCell(ci);
excelSheet.addCell(folio);
excelSheet.addCell(tipo_rec);
excelSheet.addCell(nomb_coord);
excelSheet.addCell(nomb_subc);
excelSheet.addCell(contra_pa);
excelSheet.addCell(tipo_doc);
excelSheet.addCell(desc_ser);
excelSheet.addCell(total_civa);
excelSheet.addCell(total_siva);
excelSheet.addCell(f_ini);
excelSheet.addCell(f_conclu);
excelSheet.addCell(reg_res);
excelSheet.addCell(nacionalidad);
excelSheet.addCell(fianza);
excelSheet.addCell(orig);
Valora esta pregunta


0