I am developing an application in Java to generate a list in Jasper Report, from a Json file, which can change its structure, that is, change columns and number of them ... that is, it can print a list of clients and the same application a list of articles with their header and report footer data .... After much I have managed to decipher everything and generate the application to the point where using the command "fastReportBuilder.addColumn" .. I am creating the columns .. The code is like that ...
package javaapplication11; import ar.com.fdvs.dj.domain.DynamicReport; import ar.com.fdvs.dj.domain.builders.FastReportBuilder; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Scanner; public class Reportejav { public static DynamicReport buildReport() throws ClassNotFoundException, FileNotFoundException, IOException { FastReportBuilder fastReportBuilder = new FastReportBuilder(); int contador = 0 ; String cadena; Scanner scanner = new Scanner(System.in); FileReader f = new FileReader("c:/tools/estructura.Json"); BufferedReader b = new BufferedReader(f); while((cadena = b.readLine())!=null) { contador = contador + 1; System.out.println(b.readLine()); fastReportBuilder.addColumn(cadena, cadena, String.class.getName(), 50); } fastReportBuilder.setPrintBackgroundOnOddRows(true).setUseFullPageWidth(true); return fastReportBuilder.build(); } }
The problem is that compiling it gives me ...:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/list/UnmodifiableList null at ar.com.fdvs.dj.domain.entities.DJGroup.getFooterVariables(DJGroup.java:178) at ar.com.fdvs.dj.domain.builders.DynamicReportBuilder.build(DynamicReportBuilder.java:261) at ar.com.fdvs.dj.domain.builders.FastReportBuilder.build(FastReportBuilder.java:102) at javaapplication11.Reportejav.buildReport(Reportejav.java:53) at javaapplication11.JavaApplication11.main(JavaApplication11.java:99) Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.list.UnmodifiableList at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 5 more C:\tools\jasperreports-5.0.1\JavaApplication11\nbproject\build-impl.xml:1040: The following error occurred while executing this line: C:\tools\jasperreports-5.0.1\JavaApplication11\nbproject\build-impl.xml:805: Java returned: 1 BUILD FAILED (total time: 20
and it no longer follows .. this program is called from another .Java .. but it gives the problem in the line that says.:
return fastReportBuilder.build();
Can someone explain to me what happens or why it gives that error .. I would appreciate it ...
Thank you all!!