Results 1 to 7 of 7
- 08-17-2010, 01:37 AM #1
Senior Member
- Join Date
- Apr 2010
- Location
- Philippines
- Posts
- 580
- Rep Power
- 4
iReport 3.7.4 and Netbeans 6.8 problem in library
I created the report in iReport 3.7.3 nad linked it in netbeans 6.8,
it is working great until i upgrade in iReport 3.7.4. I uninstall the 3.7.3 version and
install the 3.7.4, after that I try to load the program using coded program, it returns
no error, it loads the JDialog but do not show the report.
Then I try to:
* uninstall the netbeans 6.8
* uninstall (again) the iReport 3.7.4
* install netbeans 6.8
* install iReport 3.7.4
* add iReport plugins at netbeans
* add the iReport library in netbeans
but nothing change, it just load the JDialog but not the report.
Hope you can help me here.
HERE IS THE CODE:
Java Code:import java.awt.*; import java.sql.*; import java.util.HashMap; import javax.swing.*; import net.sf.jasperreports.swing.*; import net.sf.jasperreports.engine.*; import net.sf.jasperreports.engine.design.JRDesignQuery; import net.sf.jasperreports.engine.design.JasperDesign; import net.sf.jasperreports.engine.xml.JRXmlLoader; public class ReportView extends JDialog { String file; String query; HashMap param; public ReportView(String file, String query, HashMap param) { this.setModalityType(ModalityType.APPLICATION_MODAL); initComponents(); int width = Toolkit.getDefaultToolkit().getScreenSize().width; int height = Toolkit.getDefaultToolkit().getScreenSize().height; this.setMinimumSize(new Dimension(400, 297)); this.setLayout(new BorderLayout()); this.add(scrollview, BorderLayout.CENTER); this.setPreferredSize(new Dimension(width, height)); this.setLocation(0, 0); pack(); this.file = file; this.query = query; this.param = param; scrollview.setVisible(false); pb.setVisible(true); pb.setIndeterminate(true); showReport sr = new showReport(); sr.execute(); } public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ReportView("none", null, null).setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JProgressBar pb; private javax.swing.JScrollPane scrollview; // End of variables declaration class showReport extends SwingWorker<Void, Void> { @Override protected Void doInBackground() throws Exception { try { String url = "jdbc:mysql://server:3306/MyDatabase"; Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection conn = DriverManager.getConnection(url, "USER", "PASSWORD"); if(query != null) { JRDesignQuery aquery = new JRDesignQuery(); aquery.setText(query); JasperDesign design = JRXmlLoader.load(file); design.setQuery(aquery); JasperReport report = JasperCompileManager.compileReport(design); JasperPrint print = JasperFillManager.fillReport(report, null, conn); JRViewer viewer = new JRViewer(print); viewer.setZoomRatio(.75f); viewer.setVisible(true); scrollview.setVisible(true); scrollview.add(viewer); scrollview.setViewportView(viewer); pack(); } else { JasperReport report = JasperCompileManager.compileReport(file); JasperPrint print = JasperFillManager.fillReport(report, param, conn); JRViewer viewer = new JRViewer(print); viewer.setZoomRatio(.75f); viewer.setVisible(true); scrollview.setVisible(true); scrollview.add(viewer); scrollview.setViewportView(viewer); pack(); } } catch(Exception ex){ex.printStackTrace();} return null; } @Override protected void done() { Toolkit.getDefaultToolkit().beep(); pb.setIndeterminate(false); pb.setVisible(false); } } }
LIBRARIES:
Thanks,Java Code:jasperreports-3.7.4-project.zip jasperreports-3.7.4.jar jasperreports-applet-3.7.4.jar jasperreports-fonts-3.7.4.jar jasperreports-javaflow-3.7.4.jar
geje
- 08-17-2010, 02:02 AM #2
Senior Member
- Join Date
- Apr 2010
- Location
- Philippines
- Posts
- 580
- Rep Power
- 4
I try to debug the project it says that
Java Code:Have no FileObject for C:\Program Files\Java\jdk1.6.0_18\jre\lib\sunrsasign.jar Have no FileObject for C:\Program Files\Java\jdk1.6.0_18\jre\classes
- 08-17-2010, 04:09 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Did you check that file is exist in that location?
- 08-17-2010, 05:58 AM #4
Senior Member
- Join Date
- Apr 2010
- Location
- Philippines
- Posts
- 580
- Rep Power
- 4
Yes, I check the code and the actual path.
- 08-17-2010, 06:25 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
If the file exist, are you sure that all the necessary libraries are included into your project? (check on project properties, on NetBeans project menu).
- 08-19-2010, 01:38 AM #6
Senior Member
- Join Date
- Apr 2010
- Location
- Philippines
- Posts
- 580
- Rep Power
- 4
Sorry for late reply, problem is solve now. I look for backup of the project and copy the libraries from the back up.
Thanks,
geje
- 08-19-2010, 01:54 PM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Better to keep track of all the stuff when you are backup the projects. My advice is don't do that partially. Backup make sens if you can setup the application in a different location (should be workable) rather just keep a copy of the source code.
Similar Threads
-
iReport netbeans tutorial
By mine0926 in forum NetBeansReplies: 3Last Post: 08-16-2011, 11:12 AM -
import library into netbeans.
By IYIaster in forum New To JavaReplies: 8Last Post: 03-05-2010, 03:43 AM -
Netbeans not recognizing library
By ehsen in forum NetBeansReplies: 16Last Post: 08-30-2009, 05:32 PM -
ireport problem on print
By urtley in forum Advanced JavaReplies: 0Last Post: 08-05-2009, 11:12 PM -
Jasper Report + iReport + NetBeans 4
By Ed in forum NetBeansReplies: 2Last Post: 07-02-2007, 07:39 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks