Hey Guys,
I have integrated Jasper Reports on my netbeans platform and i am able
to generate reports using the following code.

          Map<String, Object> params = new HashMap<String, Object>();
            Connection conn =
DriverManager.getConnection("databaseUrl", "userid","password");
            JasperReport jasperReport =
JasperCompileManager.compileReport(reportSource);
            JasperPrint jasperPrint =
JasperFillManager.fillReport(jasperReport, params, conn);
            JasperExportManager.exportReportToHtmlFile(jasperPrint,
reportDest);
            JasperViewer.viewReport(jasperPrint);

This stuff works perfect.

But not i am trying to integrate Jasper with GWT.I have my server as
glass fish server.

I am getting the Connection object using the followind code.

 public static Connection getConnection() {

        try {
            String JNDI = "JNDI name";
            InitialContext initCtx = new InitialContext();
            javax.sql.DataSource ds = (javax.sql.DataSource)
initCtx.lookup(JNDI);
            Connection conn = (Connection) ds.getConnection();
            return conn;
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return null;
    }

and then

Map<String, Object> params = new HashMap<String, Object>();
             JasperReport jasperReport =
JasperCompileManager.compileReport(reportSource);
            JasperPrint jasperPrint =
JasperFillManager.fillReport(jasperReport, params, getConnection());
            JasperExportManager.exportReportToHtmlFile(jasperPrint,
reportDest);
            JasperViewer.viewReport(jasperPrint);

but i always get Error.I am implementing this on Server.I am having
RPC calls to get this method to work when a button is clicked.

Can you please help me how to work on this.(That is to integrate
Jasper reports with GWT).

I would highly appreciate any explanation with some code as i am just
a beginner.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to