AW: [reportlab-users] setting Style for a Sum in a Table

Robin Becker
Thu, 17 Oct 2002 18:37:09 +0100

In article <>, Jo- writes
>does the table know when its splitting will occure for the last time ?
>So tablestyle-commands which dependent upon the tabelend
>can maybe be set at that time....
When the split happens the splits are cast adrift; effectively the
splitting table cannot know what the results will be used for.

The first part of a split could be informed that it isn't last, would
that do?

Tables have an overrideable onSplit method

class MyTable(Table):
        def onSplit(self,T):
                if not hasattr(self,'_IAMSPLITTING'):
                        del self._IAMSPLITTING

        def draw(self):
                # _splitpart 
                #       None    never was split
                #       0       am the leading part of a split
                #       1       am the last part of a split
                _splitpart = getattr(self,'_splitpart',None)
                #... do stuff with this knowledge

I'm fairly sure the above would work, but I haven't tested it.
Robin Becker