When I add a Field Collection field to a view, a white line is shown between the the label and the value. Also, there seems to bee a double white lines between all the fields of the Field Collection. See attached pic for explanation . Is this a bug?



#5 strip_tags.png122.42 KBstevieb
#2 pdftest1.png68.29 KBsportel
#2 pdftest2.png27.08 KBsportel
fieldcollection.png30.08 KBsportel
Members fund testing for the Drupal project. Drupal Association Learn more


killua99’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs steps to reproduce

Dear fellow Drupal enthusiasts,

I have set this issue to "Postponed (Maintainer needs more information)".

If not already done please add an issue summary and steps how to reproduce the problem.
And please read again, "Making an issue report".

Help about how to do this can be found on IRC and in the user groups.

After there is new information, please re-open the issue by changing the status to active.

This issue was edited with the help of Issue Helper

sportel’s picture

27.08 KB
68.29 KB

More information / steps to reproduce:

Install the Field Collection (https://drupal.org/project/field_collection) module.
Create a new Content type (e.g.: pfd test). Add a Field Collection field (e.g.: pdftestfield).
Go to admin/structure/field-collections to add 2 fields (simple text fields will do) to the new Field Collection (e.g.: testfield1 and testfield2).
Create some new content for this content type.

Create a new View of the Content type you just created. Add the Field Collection field to the view. Add a pfd page, and see the result. Also see the screenshot I added.

I hope someone is able and willing to help and solve this. Please let me know if more info is needed.


sportel’s picture

Status: Postponed (maintainer needs more info) » Active
stevieb’s picture

the reason you have the padding in the table cells is because of the divs in the default field collection view.
the easiest way to remove these is going to the field settings and stripping all tags except the table tags.

the following code - should do it for you

stevieb’s picture

Issue summary: View changes
122.42 KB

image upload to help you find the correct settings

sportel’s picture

Thanks stevieb! That works. But is it possible to only remove the divs, so that I can keep all the other html tags?



killua99’s picture

Status: Active » Needs review

This issue need review or something??

sportel’s picture

Review of what?

killua99’s picture

Status: Needs review » Closed (won't fix)

OK, maybe not.

sportel’s picture


Ok, that's not really an answer to my question, but ok.

I reported this issue because I got some unwanted results with Views PDF, and I assumed others might have the same problem. I'm not sure if "unwanted results" should be in the category of Bug Reports, but I'm sure the problem I described is unwanted for everyone who uses Field Collection fields in a Views PDF.
Anyway, stievieb gave me a solution I can work with, I just asked a final question if he knows an other (better?) solution. Now I'm waiting for an answer. Maybe that's what you meant by "needs review"?


adelayde’s picture

Ok, thanks stevieb for that formatting answer.

Anyone able give me any pointers on the best way to format the contents of a field_collection_table with a Views PDF view?

I have a Content Type of Invoice with a field_collection field of Line Items. I wish to generate a Views PDF Display of it with the table all nicely formatted like it is on a Page Display. Under Views PDF the nice table formatting generated is lost. :(

This is what I'm trying:

1) To my View I add the Field Collection with Formatter set to 'Table of Field Collection Items'.

2) Under Rewrite Results I've stripped out all HTML bar the <table><thead><th><tr> and <td> tags as stevieb suggested.

3) Under Style Settings I've added a Custom Field and Label Wrapper HTML as a DIV with a CSS class 'invoice-line-items-table'.

4) I've then uploaded a CSS file using Views PDF's CSS file parameter in the View.

This CSS file contains:

div.invoice-line-items-table table {
    border: 1px;

But nothing happens. I'm sure I'm doing this wrong, or not taking the best approach.

What I need to be able to do is format the data in the table correctly, so that I can set column widths, right justify monetary fields, and also format these in pounds sterling - e.g. £1,200.00

I think in general I'm a bit lost as to where one is supposed to format the output of a field_collection generated content, but also when using Views PDF how to format more complex fields.

Anyone able to help?



adelayde’s picture

Hi again,

I've got around this by doing this following:

Creating a PDF Page View of the Field Collection and displaying as a Table. This enables me to set the column widths and format the output using the Settings for the Display.

I then upload my PDF template to this view and position my line items where I wish them to be.

In my main invoice view I then include my View of line items positioning it to 0,0 on the Page. This means that it then pulls in the view of the line items table as a PDF with the template and all, positioning it to the very top left and overwriting the background. I therefore don't need to use my PDF template on the top-level view of the Invoice PDF.

That's probably not that clear, I think I need to write-up how to do this. But I would be interested to know if there's a simpler way...