views:

359

answers:

1

I am new Pentaho Reporting Tool. I have the following question:

When I created a report using Pentaho Report Designer, it output a report file having .prpt extension. After that I found an example on internet where the following code were used to display the report in html format:|

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {  
     ResourceManager manager = new ResourceManager();  
     manager.registerDefaults();  
     String reportPath = "file:" +  
     this.getServletContext().getRealPath("sampleReport.prpt");  

     try {  
         Resource res = manager.createDirectly(new URL(reportPath), MasterReport.class);  
         MasterReport report = (MasterReport) res.getResource();  
         HtmlReportUtil.createStreamHTML(report, response.getOutputStream());  
     } catch (Exception e) {  
         e.printStackTrace();  
     }  
 }  

And the report got printed successfully. So as we haven't specified any datasource information here, I think that the .prpt file contains that information in it.

If that's true than Isn't Jasper is better Reporting tool than Pentaho because when we display Jasper reports, we have to provide datasource details also so in that way our report is flexible and is not bound to any particular database.

+1  A: 

Nope. The data source can be stored in the prpt, but it can be passed to the report too. And the usual way is to simply use JNDI so that you can deploy the same report, to multiple test/dev/production environments.

You'll probably get better quicker answers from the forum. forums.pentaho.org

Codek