[reportlab-users] RE: Table Height

Henning von Bargen reportlab-users@reportlab.com
Fri, 28 Nov 2003 13:24:40 +0100


It is not clear what you want to achieve:

Do you mean you want to repeat the footer on each page
of the table or do you want to see the footer only on the last page?

As you probably know, repeating the header on each page
is no problem, just use the repeatRows argument in the Table =
constructor.

If the footer should print only on the last page, there's no problem.
If you really want the footer on every page of the table, it becomes
difficult.

I think you would have to subclass the Table class
and implement the footer row yourself.
Basically this means changing the _splitRows function.
Look for the block following if repeatRows: ,
you would have to do something similar for the footer, I once =
implemented
something like this for a test.

BTW what information would you print in the footer?
Something like a running total? This could be tricky perhaps.

What you are trying right now is dividing the long table into many =
small
tables,
is that correct? I guess that's why you are trying to determine the =
height
yourself.

It seems the wrong direction for me, because it contradicts the ideas =
of
platypus.

If you're splitting the table into many small ones just for performance
reasons,
you should also try my LongTable class (I can send it to you if you =
like).
It works the same as Table, but performs much better for long tables.

Another option you can think about is to put the header and footer =
portions
into your page templates.

Henning

> -----Urspr=FCngliche Nachricht-----
> Von:	reportlab-users-request@reportlab.com
[SMTP:reportlab-users-request@reportlab.com]
> Gesendet am:	Freitag, 28. November 2003 09:06
> An:	reportlab-users@reportlab.com
> Betreff:	reportlab-users digest, Vol 1 #496 - 2 msgs
>=20
> Send reportlab-users mailing list submissions to
> 	reportlab-users@reportlab.com
>=20
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://two.pairlist.net/mailman/listinfo/reportlab-users
> or, via email, send a message with subject or body 'help' to
> 	reportlab-users-request@reportlab.com
>=20
> From: "Mau" <stormclaw@inicia.es>
> To: <reportlab-users@reportlab.com>
> Date: Tue, 25 Nov 2003 18:03:03 +0100
> Subject: [reportlab-users] Table height
> Reply-To: reportlab-users@reportlab.com
>=20
> Hi,
>=20
>     Im making an application, where I print into a pdf a data array. =
I =3D
> get each row of the array and place it in each row of a table. I fix =
the =3D
> columns width of the table. I dont fix the rows height  of the table, =
so =3D
> when I fill in the data, there are some rows higher than others (that =
is =3D
> what i want).
>     Now, in my pdf i have 3 frames, a header frame, a data frame and =
a =3D
> footer frame. The table goes inside the data frame. I tried to split =
the =3D
> data of the array in several pages by calculating the number of lines =
I =3D
> could place in the data frame and getting the same number of rows =
from =3D
> the table, but as the table has some rows higher than others (a row =
from =3D
> the array can take 3 rows from the table) i cant relay on my previous =
=3D
> calculations.
>     I was thinking of calculating the table's height or each table's =
row =3D
> height , and then split it depending on the data frame's height , but =
I =3D
> dont seem to be able to find the way, if there is one.
>=20
>=20
> so, can someone help me with this? is there away to calculate a =
table's =3D
> height or a table's row height? Am I going in the bad direction? =
Should =3D
> I try other methods?
>=20
> well, any help is welcome.
>=20
> cya.
>=20
> Mau