Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: multiple values for single parameter

  1. #1
    Join Date
    May 2007
    Posts
    128

    Default multiple values for single parameter

    I understand that the correct way to pass in multiple parameters is like this (repeating the parameter):

    https://MyCompany.com/pentaho/conten...t=0&paramint=9

    How does the engine receive this? I tried putting paramint in the header to display what was passed in and got an error (java.lang.NumberFormatException).

    I need to know two things:
    1. How can I display these in the report header
    2. How can I use these in a query


    TIA!

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

    Default

    The engine receives them as object-array filled with Integer objects. A normal number-field is not able to print that, as that field requires a single number instead.

    Display them via an ordinary text-element instead. The most recent version (PRD-3.9) prints arrays as CSV strings, all other versions can use a formula on the value-attribute of your text-element. Something like =CSVTEXT([your-parameter]) will do the trick.

    You can use them in queries like any other parameter. For SQL, the array is exploded into several parameter, so you write something like ".. WHERE p IN (${parameter}) and we rewrite the query to have a prepared-parameter for each value passed in.

    Check out the example reports, they make use of multi-selection parameter and use them to parametrize queries.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3
    Join Date
    May 2007
    Posts
    128

    Default

    Thanks for your input - I really appreciate it. However it didn't seem to work.

    I get this error:
    Failed to convert object of type class [Ljava.lang.String;: Not a String.

    This is only on the server, which I believe is the 4.0 suite.

  4. #4
    Join Date
    May 2007
    Posts
    128

    Default

    Anyone ever seen this before? If I pass in only one value (per parameter) it works fine, but if I pass in multiple, it stuffs Ljava.lang.String;@{some number} into the parameter value.

    I am using URL only - no parameter drop-down.

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.