US and Worldwide: +1 (866) 660-7555
Results 1 to 5 of 5

Thread: Calling parameter for single value query function

  1. #1
    Join Date
    Jun 2011
    Posts
    13

    Default Calling parameter for single value query function

    Hello,

    I thought this would be pretty simple, but there must be something I am missing. I have a parameter placed on the month number in my report. I want that month number to be changed to the month name so that I can include the month name in the header once the report is launched.

    I tried using a single_value_query function and used a Case statement. (i.e. Case When 1 then 'January'
    When 2 then 'February'
    etc, etc, etc.

    Although I think the problem here is that the parameter value keeps being returned as null to the query therefore it produces no results.

    How do you do this so the parameter value is not null?

  2. #2
    Join Date
    Mar 2003
    Posts
    7,986

    Default

    The SingleValueQueryFunction pulls its parameters from the current context.

    So for a call from within a report like yours, the context is all available other parameter or expressions or columns from your report's main datasource. Just reference the parameters in your query. Also: The SingleValueQueryFunction calls a query that is defined in one of the datasources. So in most cases, the name you give to the formula is a logical name as defined in the (for instance) JDBC-Datasource editor dialog.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3
    Join Date
    Jun 2011
    Posts
    13

    Default

    Awesome, never thought of that. Thanks for the help.

  4. #4
    Join Date
    Nov 2011
    Posts
    19

    Default

    Hi,

    Please can you specify how I can actually pass an input parameter to the Single VAlue Query. My input parameter is ${inputParameter} and I am trying to use the parameter in my query in a similar way. I now drag the function value onto the report and it does not show up on the report.

  5. #5

    Default parameter toa single value query in SubReport

    Quote Originally Posted by malavika View Post
    Hi,

    Please can you specify how I can actually pass an input parameter to the Single VAlue Query. My input parameter is ${inputParameter} and I am trying to use the parameter in my query in a similar way. I now drag the function value onto the report and it does not show up on the report.

    Hello,

    Were you be able to fix this ? and how ?

    Thanks !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •