[reportlab-users] Bug in manual & code?

Robin Becker reportlab-users@reportlab.com
Thu, 26 Feb 2004 13:09:44 +0000


In article <51B62EFFBC83D6118ADA00096BB030A107CADDC9@usamcms7.mc.usa.xer
ox.com>, Schollnick, Benjamin <Benjamin.Schollnick@usa.xerox.com> writes
>Either I am misunderstanding, or I suspect there is a Table / TableStyle
>bug...
>
well perhaps, but the tables.py module can be run as a test and that
contains lots of samples which use the default style as passed into the
Table() creation. I just tested and they all seem to work.

>def build_text_entry ( data, trans_table, Configuration_File, Contents):
>    
>    global height
>    global width
>    normal = ParagraphStyle ('Normal')
>    literal = ParagraphStyle ('Literal')
>    
>    table_data = []
>    for entry in trans_table:
>        table_data.append ( (entry[1], data[entry[2]]) )
>
>    tstyle     = TableStyle ( [('ALIGN', (0,0), (-1, -1), 'LEFT' ),
>                              ('GRID', (0,0), (-1, -1),  10,
>reportlab.lib.colors.black)] )
>    Table_Display = Table ( table_data, style= tstyle)
>    Table_Display.setStyle ( tstyle )
>    Contents.append ( Table_Display )
>    Contents.append ( Spacer (0, 10) )
>
>I could not get the TableStyle to work, until I added the setStyle command.
>
>But according to the documentation the Table command can have the *DEFAULT*
>style
>passed to it...
>
>               - Benjamin

-- 
Robin Becker