[reportlab-users] Re: Tablestyle.add() tuple unpack problem

James StCyr reportlab-users@reportlab.com
Tue, 24 Sep 2002 07:24:50 -0400


Disclaimer:  I'm also slogging up the ReportLab learning curve.

Disclaimer aside, I think the problem is in the syntax of the 'add' 
method.  You have:

tblstyle.add([('BACKGROUND', (0,0), (-1,0), colors.Color(0,0.7,0.7))])

When you use TableStyle you're creating a list of tuples.  When you 
execute the above statement, you're putting a list within a list.  
That's fine syntactically with Python but causing an error with 
Reportlab. 

Try this:

tblstyle.add('BACKGROUND', (0,0), (-1,0), colors.Color(0,0.7,0.7))

The ReportLab supplied example test_platypus_tables.py has helped me 
out. 


----- Original Message -----
From: Derek Basch <dbasch@yahoo.com>
Date: Tuesday, September 24, 2002 2:42 am
Subject: [reportlab-users] Re: Tablestyle.add() tuple unpack problem

> Thanks for the help,
> You are correct, I did leave out the linesize
> parameter before the color parameter for the. However,
> after adding the the linesize I still get the tuple
> unpack error. I even used the
> TableStyle.add(CommandSequence) example from the
> userguide as shown here:
> 
> http://www.geocities.com/dbasch/PDFTables.txt
> 
> and no go. Im still at a loss for what is causing
> this.
> Regards,
> Derek Basch
> 
> 
> >Derek,
> >
> >It appears that you didn't put in the line size
> >parameter.  It goes 
> >just prior to the color definition.
> >
> >Jim
> 
> 
> 
> 
> 
>  
> 
> __________________________________________________
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!
> http://sbc.yahoo.com
> _______________________________________________
> reportlab-users mailing list
> reportlab-users@reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>