B4J Question B4J JasperReports error with B4jPackager11

focus330

Member
Licensed User
Hi

I'm using b4j developing an app with MySQL as database.

The app have many reports . 90% of them has a code like this:
B4X:
    Dim jasper As JasperReports
    Dim report As JasperReport
    Dim print As JasperPrint
    Dim conn As JasperConnection
    Dim design As JasperDesign
    Dim query As JasperDesignQuery

        jasper.InitializeParameters
        jasper.InitializeJasperDesign
        jasper.GetResourceAsStream(File.Combine(Main.DirReports, "Contracts_Tart01.jrxml"))
        
        jasper.LoadJRXml(jasper.in)    '   <<<<

        jasper.InitializeJRDesignQuery

The instruction jasper.LoadJRXml(jasper.in) causes this log:

B4X:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.jasperreports.engine.util.ClassUtils (file:/D:/MatrixApk/Anywhere%20Software/B4j/AddLibraries/jasperreports-6.17.0.jar) to constructor com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl()
WARNING: Please consider reporting this to the maintainers of net.sf.jasperreports.engine.util.ClassUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

The same the report is OK .

Using the .exe created with B4jPackager11 the app crashes with the instruction jasper.LoadJRXml(jasper.in) and so no report is generated.

b4J version 9.10 Jasperreports 2.0 and Tibco.jaspersoftstudio 6.16.0

Can someone help me ? Thanks
 

focus330

Member
Licensed User
The same. with ide active it's all right. Launching the compiled jar I have an error but with other instruction :
B4X:
        ..........
        jasper.SetJRDesingQuery(query)
        design = jasper.design

        report = jasper.CompileXML2(design)   ' <<<-----'

Error is : Java.io.IOException : CreateProcess error = 2. "File not found"(Translated)
 
Upvote 0

focus330

Member
Licensed User
Now using Java 8 it's all right. To eliminate the error I had to change the %JAVA_HOME% directory using the path of my SDK 8 directory and not the standard created by JAVA SE 8.311 With the old version of B4XCompiler I create the exe and it runs.
Thank you
 
Upvote 0

focus330

Member
Licensed User
I used:
Windows 10 PRO 64
B4J 9.10
Jasperreports 2.0 installed using this istructions

Project attributes

B4X:
    #AdditionalJar: mysql-connector-java-5.1.40-bin.jar
    #AdditionalJar: sqlite-jdbc-3.32.3.3.jar
    #AdditionalJar: bcprov-jdk15on-154.jar
    #AdditionalJar: itext-2.1.7.js1.jar

In additional libraries all the indicated jars

Compiled with B4J Packager ( the old one . not 11) with java sdk 8.0.14
 
Upvote 0

focus330

Member
Licensed User
It doesn't work also with java sdk 8.0.14. My test has a simple report but using images it crashes again. Then I switch to jaspertreports 1.0 with all the limits of this version ( fonts, and field proprieties.
 
Last edited:
Upvote 0

DarkoT

Active Member
Licensed User
I used:
Windows 10 PRO 64
B4J 9.10
Jasperreports 2.0 installed using this istructions

Project attributes

B4X:
    #AdditionalJar: mysql-connector-java-5.1.40-bin.jar
    #AdditionalJar: sqlite-jdbc-3.32.3.3.jar
    #AdditionalJar: bcprov-jdk15on-154.jar
    #AdditionalJar: itext-2.1.7.js1.jar

In additional libraries all the indicated jars

Compiled with B4J Packager ( the old one . not 11) with java sdk 8.0.14
What about some alternative for JasperReports... Can me suggest to use addional/similar reporting tool (like Crystal reports or similar)? Of course need to work with B4J enviroment (maybe Reporting builder from Microsoft?!)
 
Upvote 0

focus330

Member
Licensed User
The alternative may be Next Reports. There is a JNext library you can use. Depending of what you have to do you can also create PDF or Excel sheets then print.
 
Upvote 0
Top