#1237: Report Designer - Variables - Attaching to bands
--------------------------+-------------------------------------------------
  Reporter:  lalong       |       Owner:                                       
      Type:  enhancement  |      Status:  new                                  
  Priority:  minor        |   Milestone:  0.9.2                                
 Component:  reporting    |     Version:  0.9.1                                
Resolution:               |    Keywords:  reportdesigner, pagefooter, variables
--------------------------+-------------------------------------------------
Comment (by lalong):

 Suggested mod to ReportWriter class to resolve this ticket

 1) Add the following methods
     def setGroupVar(self, groupid=0, var='Var', val=0):
         self.ReportForm['Groups'][groupid][var] = val

     def incGroupVar(self, groupid=0, var='Var', val=1):
         if not var in self.ReportForm['Groups'][groupid].keys():
             self.setGroupVar(groupid, var)

         self.ReportForm['Groups'][groupid][var] += val


     def getGroupVar(self, groupid=0, var='Var'):
         try:
             return(self.ReportForm['Groups'][groupid][var])
         except:
             return (None)

 With the above code added, we can now add an object in the group footer
 with the expression...

 self.incGroupVar(1,'Count')

 where "1" is the grouplevel and "Count" is the name if the group variable
 to process.
 Note: Any name can be used for the group variable and it auto increments
 by 1 unless a third parameter is sent.

 To retrieve the value and display it on the report, we can add a group
 that emulates a report level band, by adding a group, setting its expr=1
 and moving it to the top level.  Then, in the group footer, add an object
 with...

 self.getGroupVar(1,'Count')

 as the expr.

-- 
Ticket URL: <http://trac.dabodev.com/ticket/1237#comment:1>
Dabo Trac <http://trac.dabodev.com>
Trac Page for Dabo

_______________________________________________
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