Solved

Jasper Report Problem

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

895 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

21 Experts available now in Live!

Get 1:1 Help Now