Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Customized Reports using SDK? Is that possible?

  1. #1

    Default Customized Reports using SDK? Is that possible?

    I am conducting some research on Pentaho and I downloaded the SDK that is up on the website.


    There have been four sample files - sample1.java, sample2.java, sample3.java and sample4.java - each of which produces the report in its own fashion. Interestingly, there is a .prpt file in the SDK which is generated from the Pentaho designer.


    Questions:


    a) Can I customize the layout of the report to my requirements? Does it warrant a change in the .prpt file? If yes, can I change the .prpt file? How?


    b) If I don't have the Pentaho designer or other suite of tools on my desktop, can I not make any changes to the reporting layout?


    c) Do I definitely need to buy the suite of Pentaho tools in order to be able to generate reports? Or is the SDK enough?

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    The Pentaho Reporting Engine and the Report Designer are open-source and licensed under the LGPL. So no, no need to buy anything to just use it. But once you build a mission-critical application and want support, then getting a support contract might be a good idea.

    The reporting engine contains all the API calls necessary to create reports programmatically - and even the Report Designer just uses that API to do its job. So anything you can do in PRD, you can do via normal API calls.

    For most parts, I do recommend that users stay within the report-designer as much as possible. Use style- and attribute-expressions for layout customizations and/or use style-sheets for a similar effect. This way you can be guaranteed that your report will continue to run even after updates, as we have a strong policy to maintain compatibility of PRPT files so that old files still run the same way in newer versions of the reporting tools, without need for changes to the file.

    We naturally do not make the same assertions about the API - on major releases we take liberty to change the API if needed and some of these changes can be breaking changes, which then require changes in your code.

    If you do want to manipulate report definitions - either from scratch or after parsing a PRPT file - then use the methods available on the MasterReport object to add, change or remove elements.

    You might want to grab a copy of Will Gorman's "Pentaho Reporting for Java Developers" book for a good introduction to the API. Otherwise download the pentaho-reporting source from GitHub and have a look at the demo project, which contains a fair amount of "from scratch" reports.

    https://github.com/tmorgner/pentaho-reporting

    I would not recommend to use just the binary jars to try to find your way around the project. We are an open-source project so make use of the sources by looking at the code - or at minimum by adding the code as a reference tool to your own project.

    I also created an updated (but unofficial) version of an SDK that contains samples on how to bootstrap projects to run reports and how to extend the reporting engine by creating functions, datasources and report-pre-processors.

    https://github.com/tmorgner/pentaho-reporting-oem-sdk
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.