Hitachi Vantara Pentaho Community Forums
Results 1 to 9 of 9

Thread: Report parameters : where is the mistake?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Report parameters : where is the mistake?

    Hi to all,
    I'm trying to build my first report using pentaho reporting 3.7.0.GA under mac osx.
    I've written a parametric query
    Code:
    SELECT
         *
    FROM
         "MyView" 
    WHERE
         F1 = '{F1}'
         and F2 = '{F2}'
         and F3 = '{F3}'
    ORDER BY
         F1 ASC
    Reading this documentation page (probably old one, but it's the only that i found), i expect that the report asks me about the parameters... but nothing happens...
    I putted the parameters in the report's header just to see if the report prints them, but when i publish and launch the report i obtain a blank page with the header like this:
    This is my parameter {F1} {F2} {F3}

    i don't know where a made a mistake.
    Can you help me?

  2. #2
    Join Date
    Jan 2011
    Posts
    1

    Default

    I'm new to Pentaho as well. I too have been struggling with the parameters. That being said, I believe that you need to add parameters to the query as follows: F1 = ${F1} and F2 = ${F2} and F3 = ${F3}. Give this a try and I hope it helps.

  3. #3

    Default

    Parameter reference format should be: ${parameter-name}
    The SQL would then look like:
    SELECT
    *
    FROM
    "MyView"
    WHERE
    F1 = ${F1}
    and F2 = ${F2}
    and F3 = ${F3}
    ORDER BY
    F1 ASC

  4. #4

    Default

    nothing to do, it's the same... both the sintaxes seems to be correct, if i write '$F1' i get an error when i ask a preview... instead if i write '{F1}' or ${F1} i obtain an empty preview... but no parameters request...

  5. #5

    Default

    I found the mistake.... the report designer version.. i update to 3.8.0 and it is working...

  6. #6
    Join Date
    Apr 2011
    Posts
    7

    Default

    Hi,
    for my the good answer is :
    F1 = {F1} there are no < ' > for a parameter on SQL query

    SELECT *
    FROM MyView
    WHERE
    F1 = {F1}
    and F2 = {F2}
    and F3 = {F3}
    ORDER BY
    F1 ASC

  7. #7

    Default

    I tried with and without the ' ... anyway now in the report designer preview i obtain the right report... but when i publish it i obtain an empty report.... uff... any idea?

  8. #8
    Join Date
    Apr 2011
    Posts
    7

    Default

    Do you have make an update of your report on your server after publish your report ??

    on the entreprise console on the option

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

    Default

    @sanzo: Do you declare your parameters as the correct value type? The BI-Server needs to serialize/deserialize the parameters to get them from/to the client - if you specify parameters as plain "java.lang.Object", then that transfer may fail or the server may decide to translate your incoming data as pure strings (which would not match numeric values).

    With modern (3.7 or 3.8) BI-Server installations, the server log will tell you exactly what goes wrong when the parameter validation fails.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

Tags for this Thread

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.