Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: style expressions ignored

  1. #1
    Join Date
    Nov 2006
    Posts
    171

    Unhappy style expressions ignored

    Hi,

    I try to use style expressions in the version 1.6.0 GA with the report designer,
    but it seems all expressions are completely ignored.
    Attached a simple example: one normal label and one label with visible=false.
    Both labels are visible in the previewed and pdf report.
    I tried numeric fields with background-color etc.. No style ever shows up.
    There is very little documentation about how to use style expressions...

    The file is a .report file, but I renamed it from demo.report to demo.xml because it doesn't let me upload a .report file.

    Thanks,
    Ulrich
    Last edited by ulrich; 05-23-2008 at 10:45 AM.

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

    Default

    The style-expression in your report is not valid.

    A style-expression always starts with a "=" sign or a formula prefix (for example: "report:"). "false" is not a valid token in the formula language either, like in Excel you have to use a function to get a hard-coded boolean value. So your formula should be "=TRUE()".

    http://wiki.pentaho.org/display/Repo...la+Expressions

    Have fun,
    said Thomas
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3
    Join Date
    Nov 2006
    Posts
    171

    Default

    Okay, thanks, I thought you need the = only in the case of formulas.

    Now I have another problem. The below formula doesn't work, although by the data there should be registers in red. I checked by altering it that it treats correctly the fields alone against an integer. Can it be a problem of number types? If I replace 0.05 with 0, the registers with ConfirmErrors > 0 are red. Maybe the division produces an integer, so the result is always 0 and never fulfills the condition? Can you add a cast to float?
    The data are fetched from a cube, there the data type is numeric, although the data are integers. In the data set of the report the data type appears as object.

    Code:
    =IF([ConfirmErrors] / [Num Registers] > 0.05; "red"; "black")
    Thanks in advance,
    Ulrich

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

    Default

    There is a parse-error in the formula parser, which causes the engine to stop parsing a numeric literal if the first character after the decimal point is a zero. (This is fixed in SVN, and will be part of the next bug-fix release [which is scheduled for the next week]).

    Until then, a simple fix is to make sure that you don't trigger the bug by not having zeros after the decimal point.

    Code:
    =IF([ConfirmErrors] / [Num Registers] > (5/100); "red"; "black")
    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.