Hello,
I am a newbie to Java. I'm trying to generate reports with jasper in
netbeans 6.1. 
My code given below, runs well in Java desktop application but in jsp it
does not give any error
and simply render the html but no report shows up (not even empty) nor any
error message. 
I know i'm missing a very simple and stupid step but does not know what. 
Can somebody help me with Java code and explain why does it work in java
desktop application but not in JSP? 
Thanks in advance.

try{

            Map m=new HashMap();
            m.put("proName", "General");        //Parameters to be sent to 
report
            m.put("spID", 37);  //Parameter to be sent to report
            String reportSource = "/report/report1.jrxml";      //report folder
is in WebPages folder
            String reportDest = "/report/report1.html";
            JasperReport jasperReport =
JasperCompileManager.compileReport(reportSource);
            Class.forName("com.mysql.jdbc.Driver");
            Connection con
=DriverManager.getConnection("jdbc:mysql://localhost:3306/lisdb", "root",
"samsung");
            JasperPrint jasperPrint =
JasperFillManager.fillReport(jasperReport, m, con);
            JasperExportManager.exportReportToHtmlFile(jasperPrint,
reportDest);
            JasperViewer.viewReport(jasperPrint);
        }
        catch (JRException e){
            e.printStackTrace();
        }
        catch (ClassNotFoundException ex){
            ex.printStackTrace();
        }
        // Exception handling for the DriverManager.getConnection method.
        catch (SQLException ex){
            ex.printStackTrace();
        }

-- 
View this message in context: 
http://www.nabble.com/Help-required-jasper-report-on-netbeans-6.1-tp20395265p20395265.html
Sent from the jasperreports-questions mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions

Reply via email to