Pentaho - Reporting Tool - Is the .prpt file (report template file) contains datasource information

Posted by Yatendra Goel on Stack Overflow See other posts from Stack Overflow or by Yatendra Goel
Published on 2010-05-20T08:26:57Z Indexed on 2010/05/20 8:30 UTC
Read the original article Hit count: 442

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.

© Stack Overflow or respective owner

Related posts about java

Related posts about reporting-tools