dabo Commit
Revision 5228
Date: 2009-05-19 11:26:35 -0700 (Tue, 19 May 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5228

Changed:
U   trunk/dabo/lib/reportWriter.py

Log:
Added Show property to report band objects. If it evaluates to False, it will
not print. Thanks Larry Long for the idea! Fixes ticket #1233.

Tip: this is a good way to make a summary report. Set the detail band's Show 
property to 'self.is_summary' and put in a 'is_summary' field in the dataset 
with True or False depending on whether it is a summary or a detail report.



Diff:
Modified: trunk/dabo/lib/reportWriter.py
===================================================================
--- trunk/dabo/lib/reportWriter.py      2009-05-18 23:08:08 UTC (rev 5227)
+++ trunk/dabo/lib/reportWriter.py      2009-05-19 18:26:35 UTC (rev 5228)
@@ -480,6 +480,16 @@
                                Setting designerLock to True protects you from 
accidentally changing
                                the height of the band with the mouse at design 
time.""")
 
+               self.AvailableProps["Show"] = toPropDict(bool, True, 
+                               """Determines if the band is shown or skipped.
+
+                               Specify an expression that evaluates to True or 
False. If False,
+                               the band will not print. 
+
+                               Just like all other properties, your expression 
will be evaluated
+                               every time this object is to be printed.
+                               """)
+
        def insertRequiredElements(self):
                """Insert any missing required elements into the band."""
                self.setdefault("Objects", Objects(self))
@@ -1491,6 +1501,10 @@
                                # Band name doesn't exist.
                                return y
 
+       
+                       if bandDict.getProp("show", returnException=True) == 
False:
+                               return y
+       
                        self.ReportForm.Bands[band] = CaselessDict()
 
                        bandHeight = self.getBandHeight(bandDict)



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to