Jump to content
We've recently updated our Privacy Statement, available here ×

Error when generating columns in jasper report in Java


rcsantz

Recommended Posts

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/UnmodifiableListnull	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 moreC:toolsjasperreports-5.0.1JavaApplication11nbprojectbuild-impl.xml:1040: The following error occurred while executing this line:C:toolsjasperreports-5.0.1JavaApplication11nbprojectbuild-impl.xml:805: Java returned: 1BUILD 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!!

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...