Solved

Jasper Report Problem

Posted on 2006-07-07
3
3,019 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

756 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