Solved

Jasper Report Problem

Posted on 2006-07-07
3
3,009 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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 …

828 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