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

Thread: Single Value Query

  1. #1
    Join Date
    Jan 2008
    Posts
    177

    Default Single Value Query

    Hi
    is it possible to execute a single value query with an external query? (param, tableModel).

    --M
    Last edited by Marco Mantini; 07-12-2010 at 10:55 AM.

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

    Default

    Yes, assuming that that tablemodel used actually contains only one value. Queries on a "external-datasource" are always unparametrized and thus may or may not work for your case.

    If you need more control, use a scripting datasource or a beanshell-script-expression to get the tablemodel from the parameter and to perform whatever search or filtering you need.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3
    Join Date
    Jan 2008
    Posts
    177

    Default

    strange...because if i use a jdbc query with a single query value that's ok....if i use the same query passed via xaction (xactionn-->resultset like a parameter-->external datasource-->singlequeryvalue with this query) nothing.

    --

  4. #4
    Join Date
    Mar 2003
    Posts
    8,009

    Default

    A parameter's value is evaluated *before* the reporting engine starts working. Then the value is passed into the engine, if the report declares a parameter with such a name. If the declared parameter is declared as value type "TableModel", then we will also convert the platform's internal ResultSet object into a tablemodel object that the reporting engine can understand.

    At that point, you should be able to see a tablemodel when you access the parameter/field. If you cannot see such a value (for instance when printing it with a text-field), then your Single-Value-Query wont be able to see it either.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  5. #5
    Join Date
    Jan 2008
    Posts
    177

    Default

    ok, but in this case, the single value query with an external datasource, is not possible!
    Uhm....i don't understand..

  6. #6
    Join Date
    Mar 2003
    Posts
    8,009

    Default

    A SingleValueQuery executes a query using the datafactories attached to the report. If your query returns no value, check that you actually *have* a TableModel in that paramter. Do not assume - *check* for heavens sake.

    I can happily assure you that it is possible and has been done many many times before.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  7. #7
    Join Date
    Jan 2008
    Posts
    177

    Default

    ok Taqua, thanks for your fast reply!
    But i've just checked....but nothing
    Here my .prpt, all queries are passed correctly to a subreport, qry_totali (the source of single value query) no.
    Attached Files Attached Files

Posting Permissions

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