Results 1 to 7 of 7
  1. #1
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    4

    Default 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:
    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
    Thanks,
    geje

  2. #2
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    4

    Default

    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

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  4. #4
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    4

    Default

    Yes, I check the code and the actual path.

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    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).

  6. #6
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    4

    Default

    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

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    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

  1. iReport netbeans tutorial
    By mine0926 in forum NetBeans
    Replies: 3
    Last Post: 08-16-2011, 11:12 AM
  2. import library into netbeans.
    By IYIaster in forum New To Java
    Replies: 8
    Last Post: 03-05-2010, 03:43 AM
  3. Netbeans not recognizing library
    By ehsen in forum NetBeans
    Replies: 16
    Last Post: 08-30-2009, 05:32 PM
  4. ireport problem on print
    By urtley in forum Advanced Java
    Replies: 0
    Last Post: 08-05-2009, 11:12 PM
  5. Jasper Report + iReport + NetBeans 4
    By Ed in forum NetBeans
    Replies: 2
    Last Post: 07-02-2007, 07:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •