Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Use BSH script in parameters

  1. #1
    Join Date
    Dec 2016

    Default Use BSH script in parameters

    I would like to ask if I can use own functions, like BSH script in parameters, which I created.

    For example:
    Name:  PentaHo.png
Views: 74
Size:  14.5 KB


  2. #2
    Join Date
    Mar 2003


    You cant. Functions/expressions only get evaluated when the report runs, which by definition is after your prompts/parameter have been validated.

    You can run custom scripts via a trick though: Some prompt properties can be driven by a formula (post-processing-formula, default-value, localisation-text), and these formulas can include the "SINGLEVALUEQUERY" formula function (SVQ in short from now on). That SVQ performs a query on a report-data-source and returns the first value of the first column by default.

    We do have a ScriptableDataFactory available in PRD. Connecting the dots: Put your calculations into the data-source, return the calculation result as Single-Cell tablemodel. Then reference these calculations via the SVQ formula function. This allows you to reuse the same beanshell code in all places.
    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.