NYCPHP Meetup

NYPHP.org

[nycphp-talk] Report with line breaks

Rolan Yang rolan at omnistep.com
Tue Dec 9 10:33:11 EST 2008


Kenneth Downs wrote:
> Néstor wrote:
>> When creating a report how do you guys handle line breaks?
>> When printing a  table text table cell how do you do so that part of
>> text is not on one page and part on another?
>>
>> Thanks,
>
> Have you tried fpdf (fpdf.org) to make things in PDF format? 
>
> I tried making HTML reports a few years ago and concluded the support 
> is simply not there to make it worthwhile, and went PDF instead.
>

The CSS method will work if you allow for ample clearance between page 
margins (which, when printing in HTML, you have no control).

I have gone the fpdf route before also, but that led to it's own 
challenges such as making sure the content fits within the fixed box 
cells drawn, and then there are all the precalculations required to 
figure out how large an expandable table can be before it exceeds the 
page length and when to split the table onto the next page.

The easiest way, I think (might even be considered a cop-out!), is to 
export the table data to Excel and let the end user figure out how they 
want the report formatted. It's usually an easy sell once you point out 
that, with the data in a spreadsheet, they have the power to manipulate 
the data in hundreds of ways and generate their own additional reports.

~Rolan






More information about the talk mailing list