Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Hide element doesn't work

  1. #1

    Default Hide element doesn't work

    Hi,

    once again a problem with hiding a report element.

    I use a style expression to hide a band in case a comment is not given.

    That worked until 0.8.9ga, but doesn't with 0.8.9.1 and 0.8.9.2.

    Code:
            <band layout="canvas" padding-top="1" padding-bottom="3">
               <style-expression style-key="visible" formula="report: NOT(ISBLANK([KN_KOMMENTAR]))"/>
               <label styleClass="data-element-bold" x="1" y="0" width="14%" height="11" alignment="left" 
                            >Kommentar:</label>
               <string-field x="15%" y="0" width="85%" height="11" dynamic="true" 
                            fieldname="KN_KOMMENTAR" />
           </band>
    If the formula results to true in the beginning, the comment-band shows. Once the band is hidden, it won't show up again.

    I tried several different conditions - same problem. Other style-keys work, e.g. changing the background-color with that formula.

    Wrong xml-definition or bug?

    Thanks for any help.

    Miriam

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

    Default

    Hmmm ... cant verify this bug with the demos we have. Can you post the complete definition of that report (or at least of the whole itemband)?
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3

    Default Simple example report

    Hi,

    I cleaned up my report and deleted all unneccessary information (headers, footers,...). Still doesn't work as expected.

    As you said there is no problem with the existing demos I checked all jars to be the latest. I had to update liblayout, but that didn't fix the problem.

    So this is my example report definition (you helped me with that earlier, maybe you remember )

    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE report PUBLIC "-//JFreeReport//DTD report definition//EN//simple/version 0.8.5"
                            "http://jfreereport.sourceforge.net/report-085.dtd">
    <report name="abc">
          
        <!-- GROUP -->
        <groups>
            <group name="Daten">
                <fields>
                    <field>dummy-field</field>
                </fields>
            </group>
        </groups>
    
        <!-- ITEM BAND -->
        <items styleClass="data-element-plain" layout="block">
            <style-expression style-key="background-color" formula="report: IF(ISBLANK([KN_KOMMENTAR]); &quot;white&quot;; &quot;#DDDDDD&quot;)"/>
            <band layout="canvas" padding-top="3">
                <band layout="canvas" width="14%" border-style="solid" border-width="0.5" padding-bottom="3">
                    <string-field x="1" y="1" width="100%" height="11" fieldname="KN_NR"/>
                    <string-field x="1" y="13" width="100%" height="11" fieldname="CODE"/>
                </band>
                <string-field x="15%" y="1" width="30%" height="11" dynamic="true" 
                        fieldname="KN_NAME"/>
            </band>
            <band layout="canvas" padding-top="1" padding-bottom="3">
               <style-expression style-key="visible" formula="report: NOT(ISBLANK([KN_KOMMENTAR]))"/>
               <label styleClass="data-element-bold" x="1" y="0" width="14%" height="11" alignment="left" 
                            >Kommentar:</label>
               <string-field x="15%" y="0" width="85%" height="11" dynamic="true" 
                            fieldname="KN_KOMMENTAR" />
           </band>
        </items>
       
    </report>
    Example data:

    1. row with comment -> comment shows, highlighted
    2. row with comment -> comment shows, highlighted
    3. row w/o comment -> no comment line
    4. row with comment -> no comment line, but highlighted

    Thanks, Miriam

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

    Default

    Verified, Bug.

    http://jira.pentaho.org/browse/PRE-227

    Btw.: LibLayout is not needed in the CLassic-Engine, so there is no need to have it on the classpath.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

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

    Default

    And fixed. Hmm stupid me added a optimization that skiped the evaluation of bands that are invisible. Sadly this ignores the fact that bands can be hidden or shown by the style-expression I now skipped.

    The fix is commited to the SVN and will be part of the next bug-fix release.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  6. #6

    Default

    Thank you for the quick answer.
    We'll go back to ga then till the bug fix release is out.

    Miriam

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.