I found that this happens every time in PDF Table display (please see attached net_sales_for_category.pdf): if a row takes more than one line (e.g. product title doesn't fit into a column space) than in the beginning of a page (any page except the first one) the first row overlaps with the one below. For some reason the very first row - on every page after the first one - made to occupy only one line. If its content doesn't fit there it will overlap with the second row.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

calmforce’s picture

Issue summary: View changes
vegansupreme’s picture

Hmm, maybe we need something like Minimal Space, for tables.

This issue references minimal space, but isn't the original issue that created it.
#2344289: Minimal Space setting doesn't work
If we add this feature to table display, it shouldn't have an effect on existing users, because that setting doesn't currently exist.

If you want to make a patch, I'll do what I can to get it committed ASAP, but I don't know when I'll be able to attempt a patch myself. I'll do my best to answer any questions.

calmforce’s picture

@vegansupreme: I am not sure how Minimal Space can help here. There is row_height setting already. I believe the bug is in drawTable() function, somewhere between the lines 726 and 776. The problem demonstrates itself by printing the second row always just next to the first row on every page except the first one, assuming that the first row is always just one line. So if we give "Minimal Space" to each row, the second one may still overlap with the first one - if the first one takes several lines.

vegansupreme’s picture

Oh I see. I thought the problem was the last line was continuing onto the next page, but now I see what you mean. Line 1 doesn't have correct height, after the first page.
I'll try duplicating this problem as soon as I can.

richH’s picture

Hi

any news on this? This is a show stopper for me and it would be great to have a fix for it.

Thanks
RIch

vegansupreme’s picture

I'm looking into this. As a not so great workaround, putting the longest field last seems to prevent this bug. Looks like Views PDF calculates the height of the row based on the maximum height of all the fields, except when starting a new page—then it only uses the last field in the row, not the tallest.

mithungupta’s picture

putting the longest field last can prevent this bug if there is only one longest field but if there is more than one than again it creates problem, that's why it seems stopper for me. is there any update which can help me......

vegansupreme’s picture

I've already put a few hours into this, but haven't gotten much closer to a solution. I'll take another crack at it today.

vegansupreme’s picture

Priority: Normal » Major
vegansupreme’s picture

Status: Active » Needs review
FileSize
2.35 KB

This is the best I've got so far. It's not perfect, but it can help a bit. I noticed PDF tables weren't respecting page margins for the first page, but subsequent pages were respecting top margin at least. This fixes the margin behavior, and also helps with row overlap—as long as your margins are not very small. If you're still getting overlap with this patch, try increasing top and bottom margins until you don't get overlap anymore. Hopefully this will be a workable solution for anyone having this problem.

vegansupreme’s picture

FileSize
2.35 KB

Super small CS fix.

mithungupta’s picture

@vegansupreme: applied "Table_rows_overlap-2363889-11.patch", increased top and bottom margins. still getting row overlap.

i cant understand the fun behind these lines of codes...
@@ -25,7 +25,6 @@ class views_pdf_plugin_style_table extends views_plugin_style {
return $output;
}

-
/**
* Option definitions
*/

killua99’s picture

Assigned: Unassigned » vegansupreme
Status: Needs review » Needs work

Format better this patch, is not CS compatible.

vegansupreme’s picture

Is this patch better for CS? It still doesn't fully solve the problem though.

killua99’s picture

Status: Needs work » Needs review

I'll check it later

mithungupta’s picture

@killua99, @vegansupreme
Is there any update on it?

Thanks & Regards
mithun

killua99’s picture

Assigned: vegansupreme » killua99

Dang! I forgot about this issue. I'll add it into the trello board so I'll not forget to test it.

snowfly’s picture

Hi seting the row height in the table setings solved my case might work for you as well

killua99’s picture

@snowfly what happen if "row takes more than one line" did you test in that case?

_randy’s picture

Tested patch in #14 and the overlap and odd header bolding issue I have are resolved.

DuneBL’s picture

Patch #14 solve my issue too... many thanks!!

NWOM’s picture