************** UPDATE - 11 MARCH 2021 ******************************
The source files which I used for this library have been uploaded in this thread.
Since I have stopped working with this library and my Java knowledge is minimal, I hope that someone may use these files to find a fix for the problem listed below.
Note that the libs folder is empty - due to size limitations.
This folder contained the following files - all are available online (although I suspect some might be redundant):
commons-jexl-2.1.1
commons-logging-1.1.1
itext-2.1.7
itextpdf-5.0.6
itext-rtf-2.1.7
jcalendar-1.3.2
jtds-1.3.1
nextreports-engine-X.X
poi-3.7
xstream-1.3.1
xstream-1.4.7
*************************************************************************
*******************************************************************
IMPORTANT NOTE - 11 MAY 2020
*******************************************************************
This library works fine with Java 8.
Unfortunately, there is an important issue with OpenJDK 11.
Although non-UI apps still run fine (tested with ABMaterial app), UI apps can only run fine from the IDE.
When UI apps are packed with B4JPackager11, when the program tries to generate a report, this error appears:
As there is currently no fix for this problem, if you need to have reports on an OpenJDK11 UI-app, you need to consider other reporting libraries (e.g Jasper reports, ABMReport in ABMateriral).
*****************************************************************
jNxtReportsB4J Library allows B4J programs to handle report files generated by NextReports.
It contains just one function, which receives all its parameters in a list.
LIMITATIONS:
Library was compiled with Java 8. So, I assume, it will require Java 8 to run.
Only table reports are supported.
Charts are NOT supported.
Report files can be exported CSV, TXT, XLS, XML, PDF, HTML or RTF format.
If a report contains images, then images are automatically displayed only in the HTML format export case. In order to display images in other formats, you must edit the MANIFEST.MF file (see instructions in Step 6 below).
Output files are always exported in your application folder (i.e. where your application’s Jar file is located).
TESTING:
The demo and library supplied here have been tested on Windows 7 and Windows 8.1, running Java 8, with reports generated by Next Reports Version 8.1., against a Microsoft SQL Server database.
HOW TO USE:
Step 1
Copy your report file (i.e. a file with “report” extension, generated by Next Reports), including any images necessary for your report,into a folder of your choice.
(Next Reports by default saves report files at C:\Users\YourUserName\.nextreports-8.1\output\YourConnectionName\Reports.)
Step 2
Extract the jNxtReportsB4J.zip (it contains 3 files: jNxtReportsB4J.jar, jNxtReportsB4J.xml, nextreports-engine-8.1.jar) to the Additional Libraries folder of B4J.
Step 3
Download and save to the Libraries folder of B4J the applicable Jar files listed in the “Additional Jar” section of the demo program. All files are available on the web.
Step 4
Copy the appropriate JDBC Jar file (necessary for the database type you are using), into the Libraries folder of B4J.
Step 5
Edit, as necessary, the code of NxtReportsDemo. This demo operates on a Microsoft SQL SERVER database, outputs the report in the format specified and then opens it for viewing.
You must, at least, specify your own report name and report location (the folder where you saved your report in Step 1) plus the url and driverclass parameters applicable to your database.
Step 6 (Images)
If your report contains images, these are automatically displayed ONLY in html format. In order to display them in other formats, you must add a Class-Path parameter in the MANIFEST.MF file of the Jar file of your program. In order to do this, you must have 7-Zip and Notepad++ installed (or other programs with similar functionality). Follow these steps:
Now the MANIFEST.MF file will look like this:
Manifest-Version: 1.0
JavaFX-Version: 2.2
JavaFX-Application-Class: b4j.example.main
Created-By: JavaFX Packager
Main-Class: anywheresoftware.b4a.keywords.Common
Class-Path: .\reports\
Next, save changes and close Notepad++.
7-Zip will ask you if MANIFEST.MF file should be updated.
Press Yes.
Close 7-Zip.
You can now run your Jar file and the images will be displayed regardless of format output.
The source files which I used for this library have been uploaded in this thread.
Since I have stopped working with this library and my Java knowledge is minimal, I hope that someone may use these files to find a fix for the problem listed below.
Note that the libs folder is empty - due to size limitations.
This folder contained the following files - all are available online (although I suspect some might be redundant):
commons-jexl-2.1.1
commons-logging-1.1.1
itext-2.1.7
itextpdf-5.0.6
itext-rtf-2.1.7
jcalendar-1.3.2
jtds-1.3.1
nextreports-engine-X.X
poi-3.7
xstream-1.3.1
xstream-1.4.7
*************************************************************************
*******************************************************************
IMPORTANT NOTE - 11 MAY 2020
*******************************************************************
This library works fine with Java 8.
Unfortunately, there is an important issue with OpenJDK 11.
Although non-UI apps still run fine (tested with ABMaterial app), UI apps can only run fine from the IDE.
When UI apps are packed with B4JPackager11, when the program tries to generate a report, this error appears:
B4JPackager11 Issue with XStream
My App runs fine from the IDE. After packing with B4JPackager 11, i get this error, which seems related to xstream library. D:\ALLDOCS\JAVAPROGRAMS\JAVA11PACKBUILDS\BOXGRAPHICS\bin>java.exe @release_java_modules.txt -m b4j/b4j.example.main showreport._repshow (java line: -1)...
www.b4x.com
As there is currently no fix for this problem, if you need to have reports on an OpenJDK11 UI-app, you need to consider other reporting libraries (e.g Jasper reports, ABMReport in ABMateriral).
*****************************************************************
jNxtReportsB4J Library allows B4J programs to handle report files generated by NextReports.
It contains just one function, which receives all its parameters in a list.
LIMITATIONS:
Library was compiled with Java 8. So, I assume, it will require Java 8 to run.
Only table reports are supported.
Charts are NOT supported.
Report files can be exported CSV, TXT, XLS, XML, PDF, HTML or RTF format.
If a report contains images, then images are automatically displayed only in the HTML format export case. In order to display images in other formats, you must edit the MANIFEST.MF file (see instructions in Step 6 below).
Output files are always exported in your application folder (i.e. where your application’s Jar file is located).
TESTING:
The demo and library supplied here have been tested on Windows 7 and Windows 8.1, running Java 8, with reports generated by Next Reports Version 8.1., against a Microsoft SQL Server database.
HOW TO USE:
Step 1
Copy your report file (i.e. a file with “report” extension, generated by Next Reports), including any images necessary for your report,into a folder of your choice.
(Next Reports by default saves report files at C:\Users\YourUserName\.nextreports-8.1\output\YourConnectionName\Reports.)
Step 2
Extract the jNxtReportsB4J.zip (it contains 3 files: jNxtReportsB4J.jar, jNxtReportsB4J.xml, nextreports-engine-8.1.jar) to the Additional Libraries folder of B4J.
Step 3
Download and save to the Libraries folder of B4J the applicable Jar files listed in the “Additional Jar” section of the demo program. All files are available on the web.
Step 4
Copy the appropriate JDBC Jar file (necessary for the database type you are using), into the Libraries folder of B4J.
Step 5
Edit, as necessary, the code of NxtReportsDemo. This demo operates on a Microsoft SQL SERVER database, outputs the report in the format specified and then opens it for viewing.
You must, at least, specify your own report name and report location (the folder where you saved your report in Step 1) plus the url and driverclass parameters applicable to your database.
Step 6 (Images)
If your report contains images, these are automatically displayed ONLY in html format. In order to display them in other formats, you must add a Class-Path parameter in the MANIFEST.MF file of the Jar file of your program. In order to do this, you must have 7-Zip and Notepad++ installed (or other programs with similar functionality). Follow these steps:
- Locate your Jar file (in the Objects folder of your application).
- Right click on you Jar file and open it with 7-Zip
- Enter in the META-INF folder
- Open the MANIFEST.MF program with Notepad++
- Add a line similar to this: Class-Path: .\reports\
Now the MANIFEST.MF file will look like this:
Manifest-Version: 1.0
JavaFX-Version: 2.2
JavaFX-Application-Class: b4j.example.main
Created-By: JavaFX Packager
Main-Class: anywheresoftware.b4a.keywords.Common
Class-Path: .\reports\
Next, save changes and close Notepad++.
7-Zip will ask you if MANIFEST.MF file should be updated.
Press Yes.
Close 7-Zip.
You can now run your Jar file and the images will be displayed regardless of format output.
Attachments
Last edited: