B4J Question B4J I have error jasperreports-6.21.4.jar lib when exporting using button save in the viewer with multiplesheet XLS (*xls)

ANTONIO ALBEIRO VALENCIA

Member
Licensed User
Longtime User
file run_debug.bat:
E:\Jaspersoft\jasper-BJ\B4J\Objects\temp\build>cd bin

I made a wrapper to view Jasper reports, I have errors in the Excel export. I use these headers for project creation :

#AdditionalJar: commons-logging-1.3.5.jar
    #AdditionalJar: commons-digester-2.1.jar
    #AdditionalJar: commons-collections4-4.0.jar
    #AdditionalJar: commons-beanutils-1.9.3.jar
    #AdditionalJar: commons-javaflow-1590792.jar
    #AdditionalJar: commons-math3-3.6.1.jar
    #AdditionalJar: slf4j-api-1.7.30.jar
    #AdditionalJar: slf4j-simple-1.6.1.jar
    #AdditionalJar: groovy-4.0.26.jar 
    #AdditionalJar: openpdf-1.3.26.jar 
    #AdditionalJar: poi-4.1.2.jar
    #AdditionalJar: SparseBitSet-1.2.jar
    #AdditionalJar: com.fasterxml.jackson.core.jar
    #AdditionalJar: ecj-4.3.1.jar

    #PackagerProperty: ExeName = jasper-test
    #PackagerProperty: VMArgs = --add-opens b4j/net.sf.jasperreports.engine.fill=ALL-UNNAMED --add-opens b4j/net.sf.jasperreports.compilers=ALL-UNNAMED
    #PackagerProperty: AdditionalModuleInfoString = uses org.apache.commons.logging.LogFactory;

E:\Jaspersoft\jasper-BJ\B4J\Objects\temp\build\bin>java.exe @release_java_modules.txt --add-opens b4j/net.sf.jasperreports.engine.fill=ALL-UNNAMED --add-opens b4j/net.sf.jasperreports.compilers=ALL-UNNAMED -m b4j/b4j.example.main
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
jasper_ireport inicializado !!!
16 [JavaFX Application Thread] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
138 [JavaFX Application Thread] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
Se ha iniciado la conexion con el servidor MySQL de forma exitosa
java.lang.ExceptionInInitializerError
        at b4j/org.apache.poi.hssf.record.WriteAccessRecord.setUsername(Unknown Source)
        at b4j/org.apache.poi.hssf.record.WriteAccessRecord.<init>(Unknown Source)
        at b4j/org.apache.poi.hssf.model.InternalWorkbook.createWriteAccess(Unknown Source)
        at b4j/org.apache.poi.hssf.model.InternalWorkbook.createWorkbook(Unknown Source)
        at b4j/org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(Unknown Source)
        at b4j/net.sf.jasperreports.engine.export.JRXlsExporter.openWorkbook(Unknown Source)
        at b4j/net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(Unknown Source)
        at b4j/net.sf.jasperreports.engine.export.ExcelAbstractExporter.exportReport(Unknown Source)
        at b4j/net.sf.jasperreports.view.save.JRMultipleSheetsXlsSaveContributor.save(Unknown Source)
        at b4j/net.sf.jasperreports.swing.JRViewerToolbar.btnSaveActionPerformed(Unknown Source)
        at b4j/net.sf.jasperreports.swing.JRViewerToolbar$1.actionPerformed(Unknown Source)
        at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
        at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
        at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
        at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.desktop/java.awt.Component.processEvent(Unknown Source)
        at java.desktop/java.awt.Container.processEvent(Unknown Source)
        at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
        at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
        at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Unknown Source)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
        at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Unknown Source)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.nio.charset.UnsupportedCharsetException: Big5
        at java.base/java.nio.charset.Charset.forName(Unknown Source)
        at b4j/org.apache.poi.util.StringUtil.<clinit>(Unknown Source)
        ... 47 more
 
Last edited:

ANTONIO ALBEIRO VALENCIA

Member
Licensed User
Longtime User
Looks like the harset "Big5" is not supported.
Thanks for your reply, DonManfred. The error occurs when I create the standalone package. When I create the project in debug mode, it doesn't generate an error and exports the data correctly to Excel, Word, and PDF files. I don't know which JAR files it links in debug mode that make the project work properly.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
In debug many things are possible.
But if it crash in Releasemode then the problem is somewhere in the code used. Based on this i guess it does not work with chinese font.

I can´t help any further. NEVER used jasperreports, i never use debug-mode. I always work with releasemode.
 
Upvote 0
Top