ASF Bugzilla – Attachment 3346 Details for
Bug 13265
Could not generate Excel File. Having all ASCII characters.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
POI sample code that don't works
samplePOI.txt (text/plain), 2.49 KB, created by
FERRE Julien
on 2002-10-04 12:28:48 UTC
(
hide
)
Description:
POI sample code that don't works
Filename:
MIME Type:
Creator:
FERRE Julien
Created:
2002-10-04 12:28:48 UTC
Size:
2.49 KB
patch
obsolete
>/** Variable declarations > */ > HSSFWorkbook wb = new HSSFWorkbook(); > HSSFSheet sheet = wb.createSheet("Export"); > HSSFCellStyle style = wb.createCellStyle(); > HSSFFont font = wb.createFont(); > String strlDateHeure = null; > >/** > > ..... >*/ > try { >/** > ..... >*/ > HSSFRow rowIntitule = sheet.createRow((short) 0); > HSSFCell cellIdPiece = rowIntitule.createCell((short) 0); > HSSFCell cellTypePiece = rowIntitule.createCell((short) 1); > HSSFCell cellIdSocle = rowIntitule.createCell((short) 2); > HSSFCell cellValeur1 = rowIntitule.createCell((short) 3); > HSSFCell cellValeur2 = rowIntitule.createCell((short) 4); >/** > .... >*/ > for (k = 0; k < veclPiece.size(); k++) { > >/** > .... >*/ > > > //on remplit les cellules avec les proprietes de la piece > HSSFRow row = sheet.createRow((short) j); > row.createCell((short) 0).setCellValue(beanlPiece.getid_piece().toString()); > row.createCell((short) 1).setCellValue(strlTypePieceLibelle); > row.createCell((short) 2).setCellValue(beanlPiece.getpi_idsocle().toString()); >/** > >*/ > > > while (!objlProprietePiece.estFiniParcours()) { > > row.createCell((short) intlCompteurValeurPropriete).setCellValue( > objlProprietePiece.getpp_valeurpiece()); > > intlCompteurValeurPropriete++; > objlProprietePiece.metaAvancer(); > } //fin du while > > > } > > try { > strlDateHeure = > DateHeure.getDateduJour() + DateHeure.metaFormaterHeure(DateHeure.getHeureCourante()); > File ficlFichier = new File(getServletContext().getRealPath("/Exports/" + strlDateHeure + "_ExportPieces.xls")); > FileOutputStream foslFluxFichier = new FileOutputStream(ficlFichier); > try { > wb.write(foslFluxFichier); > foslFluxFichier.close(); > >/** > .... >*/ > } catch (java.io.IOException ioe) { > objlLog.error("Impossible de créer le fichier : " + ioe.toString()); > // redirection vers Erreur.html > response.sendRedirect("/Erreurs/Erreur.jsp"); > } > > } catch (java.io.FileNotFoundException fnfe) { > objlLog.error("Fichier non trouvé : " + fnfe.toString()); > // redirection vers Erreur.html > response.sendRedirect("/Erreurs/Erreur.jsp"); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 13265
: 3346 |
3347