Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-21-2008, 09:09 PM
Member
 
Join Date: Jun 2008
Posts: 1
sanduta is on a distinguished road
Problem with a report
I had don a report in iReport and i wont to put in a java file.
I did this button and this acction:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
String raport = "./rapoarte/classic.jasper";
String outFileName = "/rapoarte/raport1.pdf";
HashMap hm = new HashMap();

String edit, anul, anul1;

hm.put("nume", edit);
hm.put("prenume", anul);
hm.put("data_internare",anul1);

try {
JasperReport jasperReport = JasperCompileManager.compileReport(raport);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, hm, cnx);
JasperViewer.viewReport(jasperPrint, false);

}
catch (JRException ex) {
ex.printStackTrace();
}
}

I have an error in this lines:
hm.put("nume", edit);
hm.put("prenume", anul);
hm.put("data_internare",anul1);

variable edit might not have been initialized

Help me please
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-26-2008, 03:14 PM
pao pao is offline
Member
 
Join Date: Jun 2008
Posts: 41
pao is on a distinguished road
Initialise the reference 'edit' before you try to pass into a method....

Code:
String edit, anul, anul1; hm.put("nume", edit);
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jasper report + JPQL tarat Advanced Java 2 08-01-2008 07:47 PM
Crystal report with JSP fred JavaServer Pages (JSP) and JSTL 1 08-05-2007 05:34 AM
Error With Sql And Jasper Report Heather Database 3 07-31-2007 07:07 AM
Crystal Report with Java Jack Advanced Java 2 07-02-2007 02:39 PM
Big Faceless Report Generator 1.1.36 levent Java Announcements 0 06-20-2007 08:36 AM


All times are GMT +3. The time now is 02:44 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org