#NEWLINE# def dump2html( self , tble , data_iterator , column_names = None , hide_sums = None ) : #NEWLINE# #INDENT# '\n        Render this table into an existing\n        :class:`lino.utils.xmlgen.html.Table` instance.\n\n        ' #NEWLINE# ar = self #NEWLINE# tble . attrib . update ( self . tableattrs ) #NEWLINE# tble . attrib . setdefault ( 'name' , self . bound_action . full_name ( ) ) #NEWLINE# grid = ar . ah . list_layout . main #NEWLINE# columns = grid . columns #NEWLINE# ( fields , headers , cellwidths ) = ar . get_field_info ( column_names ) #NEWLINE# columns = fields #NEWLINE# headers = [ x for x in grid . headers2html ( self , columns , headers , ** self . cellattrs ) ] #NEWLINE# sums = [ fld . zero for fld in columns ] #NEWLINE# if cellwidths : #NEWLINE# #INDENT# for ( i , td ) in enumerate ( headers ) : #NEWLINE# #INDENT# td . attrib . update ( width = six . text_type ( cellwidths [ i ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# tble . head . append ( xghtml . E . tr ( * headers ) ) #NEWLINE# recno = 0 #NEWLINE# for obj in data_iterator : #NEWLINE# #INDENT# cells = ar . row2html ( recno , columns , x , sums , ** self . cellattrs ) #NEWLINE# if ( cells is not None ) : #NEWLINE# #INDENT# recno += 1 #NEWLINE# tble . body . append ( xghtml . E . tr ( * cells ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( recno == 0 ) : #NEWLINE# #INDENT# tble . clear ( ) #NEWLINE# tble . body . append ( ar . no_data_text ) #NEWLINE# #UNINDENT# if ( hide_sums is None ) : #NEWLINE# #INDENT# hide_sums = ar . actor . hide_sums #NEWLINE# #UNINDENT# if ( not hide_sums ) : #NEWLINE# #INDENT# has_sum = False #NEWLINE# for i in sums : #NEWLINE# #INDENT# if i : #NEWLINE# #INDENT# has_sum = True #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# if has_sum : #NEWLINE# #INDENT# cells = ar . sums2html ( columns , sums , ** self . cellattrs ) #NEWLINE# tble . body . append ( xghtml . E . tr ( * cells ) )