Re: [java-l] generación de planilla excel en java

puede ser la versión del poi...deberías actualizarlo

El 31 de octubre de 2012 16:30, Jorge Curbelo <jorge_curbelo@hotmail.com> escribió:
pasé a una pc con xp y anda perfecto.
 
una de dos o es el sistema operativo o tengo algo mal instalado en mi pc.
 
debería andar con windows 7.
 
saludos
 

Date: Wed, 31 Oct 2012 15:09:27 -0500
From: wilmansalazar@gmail.com

To: java-l@gxtech.com.uy
Subject: Re: [java-l] generación de planilla excel en java

bueno y porque no probas con un procedimiento generado por pattern y lo comparas contra el tuyo. 

El 31 de octubre de 2012 14:07, Jorge Curbelo <jorge_curbelo@hotmail.com> escribió:
Ev1
 

Date: Wed, 31 Oct 2012 16:29:41 -0200
From: pablo@cybernet.com.uy
To: java-l@gxtech.com.uy
Subject: Re: [java-l] generación de planilla excel en java


Jorge,
¿Qué versión de GX estás usando? En GX Ev2 cambiaron la versión del poi.jar, de repente tenés desactualizado tu poi.jar.

Cuando decís que lo corrés como main, ¿lo corrés como command line o como http desde el browser?
Si fuera command line, apoyaría la suposición de que estás trabajando con distintas versiones de poi.jar.

Saludos,
Pablo


From: "Jorge Curbelo" <jorge_curbelo@hotmail.com>
To: java-l@gxtech.com.uy
Sent: Miércoles, 31 de Octubre 2012 16:10:08
Subject: [java-l] generación de planilla excel en java

Tengo el siguiente procedimiento que genera una planilla excel:
&Path = "C:\Tomcat\webapps\SisCODJavaEnvironment\"

// Exports the contents of a grid (using the selected order and filters) to an Excel file.

&Random = Random() * 10000

&Filename = !"PublicTempStorage\Xls_Historico-" + &Random.ToString().Trim() + !".xls"

&PathFile = &Path.Trim() + &Filename.Trim()

&ExcelDocument.Open(&PathFile)
Do 'CheckStatus'
&ExcelDocument.Clear()

&CellRow = 1
&FirstColumn = 1

// Write titles
&ExcelDocument.Cells(&CellRow, &FirstColumn + 0).Text = 'Cód.'
&ExcelDocument.Cells(&CellRow, &FirstColumn + 1).Text = 'Artículo'
&ExcelDocument.Cells(&CellRow, &FirstColumn + 2).Text = 'Unidad'
&ExcelDocument.Cells(&CellRow, &FirstColumn + 3).Text = 'Variante'
&ExcelDocument.Cells(&CellRow, &FirstColumn + 4).Text = 'Medida Variante'
&ExcelDocument.Cells(&CellRow, &FirstColumn + 5).Text = 'Present.'
&ExcelDocument.Cells(&CellRow, &FirstColumn + 6).Text = 'Unidad Present'
&ExcelDocument.Cells(&CellRow, &FirstColumn + 7).Text = 'Código'
&ExcelDocument.Cells(&CellRow, &FirstColumn + 8).Text = 'Descripción'
&ExcelDocument.Cells(&CellRow, &FirstColumn + 9).Text = 'Operación'
&ExcelDocument.Cells(&CellRow, &FirstColumn + 10).Text = 'Registro'
&ExcelDocument.Cells(&CellRow, &FirstColumn + 11).Text = 'Fecha Movim'
&ExcelDocument.Cells(&CellRow, &FirstColumn + 12).Text = 'Hora'

For each
order LogCodId when &OrderedBy = 1
order LogCodDsc when &OrderedBy = 2
where LogUsuario = &Usuario
where LogCodId >= &LogCodId
where LogCodDsc like '%' + &LogCodDsc.Trim().ToUpper() + '%' when not &LogCodDsc.IsEmpty()
where LogFamId = &LogFamId when not &LogFamId.IsEmpty()
where LogSFaId = &LogSFaId when not &LogSFaId.IsEmpty()
where LogClaId = &LogClaId when not &LogClaId.IsEmpty()
where LogSClId = &LogSClId when not &LogSClId.IsEmpty()

// Write cell values
&CellRow += 1
&ExcelDocument.Cells(&CellRow, &FirstColumn + 0).Number = LogCodId
&ExcelDocument.Cells(&CellRow, &FirstColumn + 1).Text = LogCodDsc
&ExcelDocument.Cells(&CellRow, &FirstColumn + 2).Text = LogCodUniDsc
&ExcelDocument.Cells(&CellRow, &FirstColumn + 3).Text = LogVarDsc
&ExcelDocument.Cells(&CellRow, &FirstColumn + 4).Text = LogMedDscVar
&ExcelDocument.Cells(&CellRow, &FirstColumn + 5).Text = LogPreDsc
&ExcelDocument.Cells(&CellRow, &FirstColumn + 6).Text = LogCodUniDsc
&ExcelDocument.Cells(&CellRow, &FirstColumn + 7).Text = LogMedVArtCodigo
&ExcelDocument.Cells(&CellRow, &FirstColumn + 8).Text = LogMedVDscCodigo
&ExcelDocument.Cells(&CellRow, &FirstColumn + 9).Text = LogOperacion
&ExcelDocument.Cells(&CellRow, &FirstColumn + 9).Text = LogTipoReg
&ExcelDocument.Cells(&CellRow, &FirstColumn + 11).Date = LogFchMov
&ExcelDocument.Cells(&CellRow, &FirstColumn + 12).Text = LogHora
Endfor

&ExcelDocument.Save()
Do 'CheckStatus'
&ExcelDocument.Close()

Sub 'CheckStatus'
If (&ExcelDocument.ErrCode <> 0)
&Filename = ""
&ErrorMessage = &ExcelDocument.ErrDescription
&ExcelDocument.Close()
Return
Endif
Endsub

Si lo corre solo como main me genera la planilla.
Pero si lo corro desde el web-panel así:
Event 'DoExport'
Xls_Historico.Call(&Usuario, &OrderedBy, &cCodId, &cCodDsc, &cFamId,
&cSFaId, &cClaId, &cSClId, &ExcelFilename, &ErrorMessage)

If (&ExcelFilename <> "")
Link(&ExcelFilename)
Else
msg(&ErrorMessage)
Endif
EndEvent

Me da el siguiente error:

Estado HTTP 500 -


type Informe de Excepci�n

mensaje

descripci�n El servidor encontr� un error interno () que hizo que no pudiera rellenar este requerimiento.

excepci�n

javax.servlet.ServletException: java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFCell.setEncoding(S)V  	at com.genexus.gxoffice.poi.ExcelCells.setText(Unknown Source)  	at xls_historico.privateExecute(xls_historico.java:109)  	at xls_historico.execute_int(xls_historico.java:90)  	at xls_historico.execute(xls_historico.java:63)  	at asocia2_impl.e164H2(asocia2_impl.java:1452)  	at asocia2_impl.evt4H2(asocia2_impl.java:435)  	at asocia2_impl.dispatchEvents(asocia2_impl.java:256)  	at appmasterpage_impl.evt012(appmasterpage_impl.java:245)  	at appmasterpage_impl.ws012(appmasterpage_impl.java:154)  	at appmasterpage_impl.webExecute(appmasterpage_impl.java:55)  	at asocia2_impl.webExecute(asocia2_impl.java:114)  	at com.genexus.webpanels.GXWebObjectBase.doExecute(Unknown Source)  	at asocia2.doExecute(asocia2.java:20)  	at com.genexus.webpanels.GXWebObjectStub.callExecute(Unknown Source)  	at com.genexus.webpanels.GXWebObjectStub.doPost(Unknown Source)  	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)  	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)  	at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:402)  	at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:170)  	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)  	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)  	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)  	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)  	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)  	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)  	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)  	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)  	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)  	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)  	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)  	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)  	at java.lang.Thread.run(Unknown Source)    	com.genexus.webpanels.GXWebObjectStub.callExecute(Unknown Source)  	com.genexus.webpanels.GXWebObjectStub.doPost(Unknown Source)  	javax.servlet.http.HttpServlet.service(HttpServlet.java:637)  	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)  	org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:402)  	org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:170)  	javax.servlet.http.HttpServlet.service(HttpServlet.java:637)  	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)  

nota La traza completa de la causa de este error se encuentra en los archivos de diario de Apache Tomcat/6.0.18.


Apache Tomcat/6.0.18

Lo corrí con el debug y el error da cuando intenta cargar la primer celda.

 

Espero que me puedan ayudar, ya que no se porque está cancelandose.

 

Desde ya gracias.

 

E



--


Imágenes integradas 1
Wilman Salazar
Desarrollador Gx
MundoSystem Colombia
Cel: 3163695271





--

Imágenes integradas 1

Wilman Salazar

Desarrollador Gx

MundoSystem Colombia

Cel: 3163695271


--
 
 

0 Response to "Re: [java-l] generación de planilla excel en java"

Publicar un comentario