Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Formulas for labels not working in 3.5?

  1. #1
    Join Date
    Apr 2007
    Posts
    2,009

    Default Formulas for labels not working in 3.5?

    Hi, I have this code in 3.5, which fails, but used to work in 1.7. Whats weird is that nothing is displayed!

    What have i done wrong? ( I want to conditionally display some text based upon the content of a field. )


    Code:
    IF([DEF_SUBMITTER_GROUP]="x";"blurb1";"blurb2");
    ?

    b.t.w. no errors in console, or warnings about this; It just doesnt display; I dont see how it doesnt display at all!

    Thanks,
    Dan

  2. #2
    Join Date
    Apr 2007
    Posts
    2,009

    Default

    Doh! rookie mistake - no = at the start!!

    raised this to help people like me not concentrating on the job in hand

    http://jira.pentaho.com/browse/PRD-2297

  3. #3
    wvaibhav Guest

    Default similar problem resolved

    Hi,

    Following is the problem which I faced for using the formula and the exact solution was the same, i missed out = sign in the formula.... . Here is the link for coloring row band/element.

    http://forums.pentaho.org/showthread...ighlight=color

    Vaibhav

  4. #4
    Join Date
    Sep 2008
    Posts
    16

    Default

    I'm wondering if this Formula is running, even with '='.
    I experienced an odd behaviour of 3.5 where Formulas are not interpreted if there's a ';' at the end of the line.

    For example:
    Formula =[year]-4; is what the Report Designer of 1.7 and 2.0 produces and the Report works in 2.0.

    In 3.5 this Report isn't working, the Field is blank.
    If I change the Forumula to: =[year]-4 (without semicolon) it works in 3.5.

    Unfortunately the old Report Designer won't let me do this (so i have to change every formula via Editor) and the new one doesn't know xml-Report Files anymore.

    Really annoying.

  5. #5
    wvaibhav Guest

    Default there are lot of speed breakers in the city

    Hi,

    It may be possible, at certain time, when everything is fine, something is annoying. Everything can't be as you want in the way you want. At some time you may feel something is annoying, it is open source, if you want to make it less annoying, you can try contributing and resolve it and make the world more happy and less annoying....

    Hope everybody agrees with me.

    Vaibhav

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

    Default

    @mschips: If you open the *.report file in PRD-3.5, the report-designer should remove the trailing semicolon automatically. If you open *.xml files (published reports), this correction will not be made, as the semicolon was never allowed in the first place.

    The *,xml files cannot safely be converted to the new format, as it is so low-level that we cannot safely start converting elements and properties into higher level structures.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  7. #7
    Join Date
    Sep 2008
    Posts
    16

    Default

    I see...

    so the Report Designer of 1.7 and 2.0, which automatically adds a semicolon to the Formulas isn't supported anymore in 3.5 ?

    I have to convert every Report containing Formulas to the new .prpt Format of 3.5 ?

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

    Default

    The ";" was never correct. But the old formula parser ignored garbage at the end of a formula. So a formula like

    =("Your text") (öafjösdf aöejölsgj laösdkfj)

    is parsed as a correct formula. This obviously caused severe troubles for all those cases where you work with the formula structures.

    The new report-designer does not support XML file writing. But this is not needed anyway, as even the old jfreereport-component can parse the *.prpt files. You just have to make sure you dont add parameters (as the old component does not support parameters) and that you dont add datasources to subreports (as this is not what the old report-designer did, and thus you may get unexpected results).

    However, old reports that worked in 3.0 should work in 3.5. So please file a bug-report and you get a fix in the next iteration.
    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.