[reportlab-users] Splitting tables with repeated ROWBACKGROUNDS

Axel P. Kielhorn python-rl at axelkielhorn.de
Sun Mar 22 03:01:17 EDT 2020


Am 21.03.2020 um 15:01 schrieb Robin Becker <robin at reportlab.com>:
> 
> Hi Axel,
> 
> wasn't quite sure what a double row was, but I guess you just mean that the rows are associated with each other in terms of background colour.
> 
> I think I understand the problem after looking at your example.

I thought it would be easier to test your ideas on something, instead of writing code based on my description.

> So logically in your example you want the first two rows to be a specific background colour and then have the colour alternate between grey and white. Currently the ROWBACKGROUNDS argument is just a list and to accomplish what you seem to want it needs more structure eg a history of where in the sequence it is and the rendering needs to know about repeat rows etc etc.

ROWBACKROUNDS is just a visual representation.
Maybe this is the wrong way round:
- there could be a logical description of some sort of grouping.
- these groupings get different colours.

> I'll have a think.

Thanks.
In the meantime I implemented my suggestion from yesterday and added an empty column with a span.
It works in the test case.

There is one minor issue: The table on page 2 starts with the wrong colour.
Changing the ROWBACKGROUNDS definition fixed that.

Have a nice weekend and stay safe.

Axel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rl-ecm.py
Type: text/x-python-script
Size: 3350 bytes
Desc: not available
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20200322/d605d5dd/attachment.bin>


More information about the reportlab-users mailing list