[reportlab-users] Re: Ammendment: Allow Blank Cells in Platypus Table

Henning von Bargen H.vonBargen at t-p.com
Fri May 5 04:47:50 EDT 2006


> What do people think?  Should tables accept occasional 'short rows' and
> pad to the right with empty cells, or be strict about demanding 
> rectangular input of the correct number of columns?

Tables should be strict about demanding rectangular input.
If data is missing, then the padding should be the left to the developer.

This makes programming or data errors visible (I mean, you get an exception).
This is most important for real-world and commercial programming.

Say you have a programming error in your report which causes too short rows
in rare cases (which didn't happen in your test environment for some reason).

And now imagine this rare case is for a real-world error condition
(say, one parameter of your production process is outside of the 
specification range), which means your production is garbage.

If RL would pad automatically, nobody would notice the error -
the user looking at the report does not see your ALERT column data
and thinks that everything is fine.

Instead, if the report fails with an exception, the user would
notice at least that something is wrong.

He will not notice the real-world problem at first glance from
the Python stack trace, but he will perhaps take a closer look
at the data in your application (and THEN notice the error),
or at least call his IT hotline (that is: you, probably) and you
the will look at the stack trace and call the user back and say
something like "This might have to do with the data; the program
is in a routine that handles out-of-specification conditions..."
and then you might hear some hetic and footsteps and someone
hitting the big red "STOP Production" button...

I know this is a worst case scenario, but we all know:
What can go wrong, will go wrong.

So if you *expect* your data to be incomplete, 
please handle that situation yourself.

Just my 0,02 EUR.

Henning



More information about the reportlab-users mailing list