Solved

Jasper Report Problem

Posted on 2006-07-07
3
2,967 Views
Last Modified: 2011-10-06
Hi all  Java Guru,
      i m using java 1.5 and following libs for creating jasper reports for my project.
mysql-connector-java-3.1.11.bin.jar
commons-beanutils-1.5.jar
commons-collections-2.1.jar
commons-digester-1.7.jar
commons-javaflow-20060411.jar
commons-logging-1.0.2.jar
itext-1.3.1.jar
jasperreports-1.2.2.jar
jdt-compiler.jar
xml-apis.jar
      column(field) has an alias name ,I m getting error when while filling report :

      net.sf.jasperreports.engine.JRException: Unknown column name : ContactDesignation
      at net.sf.jasperreports.engine.JRResultSetDataSource.getColumnIndex(JRResultSetDataSource.java:357)
      at net.sf.jasperreports.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:113)
      at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:727)
      at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:983)
      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:126)
      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:750)
      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:647)
      at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63)
      at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402)

mine code as follows :
      try
      {
      long start = System.currentTimeMillis();
      JasperDesign jasperDesign = JRXmlLoader.load(fileName);
      System.out.println("JasperDesign Name -- "+jasperDesign.getName());
      JasperCompileManager.compileReportToFile(fileName);
      JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
      System.err.println("Compiled Name -- "+jasperReport.getName());
      System.err.println("Compile time : " + (System.currentTimeMillis() - start));
      JasperPrint jasperPrint =JasperFillManager.fillReport(jasperReport, parameters, getConnection());
      System.err.println(jasperPrint.toString());
      System.err.println("Filling time : " + (System.currentTimeMillis() - start));
}

any one have idea abt this issue, plz help me. thx in advance.
Regards.
0
Comment
Question by:Econify
3 Comments
 
LVL 1

Accepted Solution

by:
bunin76 earned 500 total points
ID: 17097587
From the exception I understand that there is some field in the report that points to field "ContactDesignation" from the DB, which is unregistered in the report, or missing from DB.

Try using GUI tools for jasperreports. I worked with  http://ireport.sourceforge.net
There are convenient options to design the reports.

Hope this helps.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now