[reportlab-users] problem with List printing with reportlab
Marco Bizzarri
marco.bizzarri at gmail.com
Wed Jul 9 07:49:19 EDT 2008
Hi, Gabriele, I'm not sure I understood your problem.
I think you've to explain your problem a little. You can obtain the
length of a list l using len(l), so you could not in that place what
is the length of the list.
I do not understand what the length of the list has to do with the
sorting of the list itself.
The output of you're seeing is the string representation of a list of strings.
You could do something like this:
to_be_sorted = self.AccLabelList[:]
to_be_sorted.sort()
start = 650
for label in to_be_sorted:
sheet.drawString(45, start, label)
start = start + 25
Is this useful for you?
Regards
Marco
On Wed, Jul 9, 2008 at 1:11 PM, Gabriele Visconti
<gabriele.visconti at gmail.com> wrote:
> Hi everyone,
> I have one list which is dynamically modified. The elements are continuously
> added and removed depending on variables state.
> How can I print this list on a canvas so that the list elements are listed
> one below the other.
> To explain me better.
> I now do something like this:
> sheet.drawString(45, 650, str(self.AccLabelList[:]))
> What I obtain on the pdf is this:
> [u'D Heating collar inclusive of installation and accessory', u'Ec Suction
> DN40/degasing DN10 automatic valves with installation(for LDPD - K with gas
> separator)']
> What I want to obtain on the pdf is this:
> D Heating collar inclusive of installation and accessory
> Ec Suction DN40/degasing DN10 automatic valves with installation(for LDPD -
> K with gas separator)
>
> The problem is that I can't sort the list elements and just place them on
> the canvas because each time I don't know how many elements are stored in
> the list.
> Is it something that can be obtained in someway?
>
> Thank you very much,
>
> Gab
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
>
--
Marco Bizzarri
http://iliveinpisa.blogspot.com/
More information about the reportlab-users
mailing list