Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: XAction's resultsets and non-JFree engine

  1. #1
    Join Date
    Jan 2008
    Posts
    1

    Default XAction's resultsets and non-JFree engine

    How can I use non flat parameters, for example result set from some data source (e.g. sql query, kettle transformation), defined in xaction sequence in foreign engine's (BIRT or Jasper) report definitions. I have discovered only simple string parameter example with BIRT and Jasper in wiki.

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

    Default

    The problem with the other engines is, that they insist on doing the Query by themselves. They do not provide a option to pass in the result-set (or if they do, no one ever implemented it for the platform). Same goes for "complex" parameters - the engines make certain assumptions and usually keep their code relatively closed.

    The main advantage of the Pentaho Reporting Engine is not the rich set of features. Jasper and BIRT and Pentaho-Reporting mainly have the same core features. But the Pentaho Engine emphasizes the embedded use-cases, we deliberately keep our system as open and as non-intrusive as possible. This way it is easy, if not obvious how to embed our engine into a complex structure like the Pentaho Platform without bending backwards.

    Both the Jasper and BIRT components basically provide just the minimum set of features. And until someone with deep knowledge of these reporting engines steps up, these components are likely to stay at that level.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3

    Default Easily doable with JasperReports

    Quote Originally Posted by Taqua View Post
    The problem with the other engines is, that they insist on doing the Query by themselves. They do not provide a option to pass in the result-set [...]
    With JasperReports, it's quite posible to provide a result-set, just by providing an implementation of the net.sf.jasperreports.engine.JRDataSource interface. In fact, I've done some maintenance on an in-house application where there are several classes that generate Jasper reports ready to run, and each one has a nested subclass that implements JRDataSource (about 10 lines of code each time; although it could probably be refactored into a single adapter class).

  4. #4
    Join Date
    Nov 2007
    Posts
    4

    Default Unable to use javascript to create ReportSpec

    Hi

    not sure whether this is a right place to post this one.

    I am trying to create a dynamic reportSpec object using javascript.

    function getReportSp() {
    var reportSp = new Packages.org.pentaho.jfreereport.castormodel.reportspec.ReportSpec();
    //reportSp.setUseRowBanding(false);
    var colHeaders = resultSet.getMetaData().getColumnHeaders()[0];
    for(var i = 0; i < colHeaders.length; i++) {
    var field = new Packages.org.pentaho.jfreereport.castormodel.reportspec.Field();
    field.setName(colHeaders[i].toString());
    field.setDisplayName(colHeaders[i].toString());
    field.setIsDetail(true);
    reportSp.addField(field);
    }
    return Packages.org.pentaho.jfreereport.wizard.utility.report.ReportGenerationUtility.createJFreeReportXML(reportSp);
    }
    getReportSp();

    this doesnot work

    Error: RuntimeContext.ERROR_0012 - ActionDefinition for JFreeReportComponent did not execute successfully (org.pentaho.core.runtime.RuntimeContext)
    Error: SolutionEngine.ERROR_0007 - Action sequence execution failed (org.pentaho.core.solution.SolutionEngine)

    Where as

    function getReportDefinition() {
    var reportSpec = new Packages.org.pentaho.jfreereport.castormodel.reportspec.ReportSpec();
    //reportSpec.setUseRowBanding(false);
    var regionField = new Packages.org.pentaho.jfreereport.castormodel.reportspec.Field();
    regionField.setName("REGION");
    regionField.setDisplayName("Region: $(REGION)");
    regionField.setHorizontalAlignment("left");
    regionField.setIsDetail(false);
    reportSpec.addField(regionField);

    var deptField = new Packages.org.pentaho.jfreereport.castormodel.reportspec.Field();
    deptField.setName("DEPARTMENT");
    deptField.setDisplayName("Department");
    deptField.setIsDetail(true);
    deptField.setUseItemHide(true);
    reportSpec.addField(deptField);
    var positionField = new Packages.org.pentaho.jfreereport.castormodel.reportspec.Field();
    positionField.setName("POSITIONTITLE");
    positionField.setDisplayName("Position");
    positionField.setIsDetail(true);
    reportSpec.addField(positionField);
    var actualField = new Packages.org.pentaho.jfreereport.castormodel.reportspec.Field();
    actualField.setName("ACTUAL");
    actualField.setDisplayName("Actual");
    actualField.setIsDetail(true);
    actualField.setType(1);
    actualField.setExpression("sum");
    reportSpec.addField(actualField);
    var budgetField = new Packages.org.pentaho.jfreereport.castormodel.reportspec.Field();
    budgetField.setName("BUDGET");
    budgetField.setDisplayName("Budget");
    budgetField.setIsDetail(true);
    budgetField.setType(1);
    budgetField.setExpression("sum");
    reportSpec.addField(budgetField);
    var varianceField = new Packages.org.pentaho.jfreereport.castormodel.reportspec.Field();
    varianceField.setName("VARIANCE");
    varianceField.setDisplayName("Variance");
    varianceField.setIsDetail(true);
    varianceField.setType(1);
    varianceField.setExpression("sum");
    reportSpec.addField(varianceField);

    return Packages.org.pentaho.jfreereport.wizard.utility.report.ReportGenerationUtility.createJFreeReportXML(reportSpec);
    }
    getReportDefinition();


    works fine.

    if i save the output of the first javascript and then use it for my report action, it works fine.
    Last edited by rreddy; 01-29-2008 at 03:14 AM.

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.