Fields set as being excluded from display in the views interface are not set as headers but are printed in the data rows when exporting table views to either csv or doc files. We have not tested the issue with other output formats so cannot say that it does not occur there.

CommentFileSizeAuthor
#5 respect_export.patch558 bytesandreiashu
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

_paul_meta’s picture

Further to this, as a useful feature for this module - it would perhaps be ideal if each field can be selectively used in the csv export.

For example: I have a list of nodes with specific cck fields being displayed in the view which i want to have exported in the csv file. For usability/workflow, i provide a node edit and node delete link as fields in the view also. I wish to have these visible in the page view, but not in the csv export. currently there is no way to do this.

Thanks for a great module!

asak’s picture

This bug is a little bit more tricky, but it surly exists.

I have managed to get 1 view to output a CSV file, respecting excluded fields, and nicely outputting more complex custom php field and tokens as well - great stuff!

Now - i had many problems getting it to work, and i'm now struggling with another view which i can't figure out what's stopping it from working. I can't point my finger at a specific issue - and can't find any logic - but can't get it work... tried it all...

asak’s picture

I'm using the same fields settings for the page view and the feed view - the page displays correctly, the CSV (and views preview) are not correct.

I think it's not that tricky after all - it simply doesn't work.

DarrellDuane’s picture

subscribing, I have this problem.

andreiashu’s picture

Assigned: Unassigned » andreiashu
Status: Active » Needs review
FileSize
558 bytes

Hi,
This patch should fix the problem.

Cheers

neclimdul’s picture

Status: Needs review » Fixed

Looks like this is a follow up to #422438: Date fields terminate CSV export on some versions of PHP. Committed. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

DarrellDuane’s picture

I am still having this problem. The reports Header shows up correctly (values are hidden) but I still see actual data showing up when it is supposed to be hidden. This means that my report ends up with an extra column (or more) and that the data is offset at the point where the hidden column is listed.

I'm using hidden columns 'cos I need the data for php. I will try to set up my view without a hidden column.

kruser’s picture

subscribe - I have this problem too.

adr75’s picture

Version: 6.x-1.0-beta4 » 6.x-1.1
Status: Closed (fixed) » Active

I am having this problem as well. Made a View based on 4 CCK text fields. First 3 fields are excluded from display, and the output of the 4th one is rewritten to generate the row output. Attaching a feed display to a Page works fine but all export options generate the Views content incorrectly. The export results appears to have duplication of the very first row and an incorrect rewrite of field 4.

Toggling the excluded fields back to visible renders correct output (including correctly rewritten fields).

adr75’s picture

Assigned: andreiashu » Unassigned

Although I would prefer the Bonus module to take care of this, a work-a-around would be:
-Don't use "Exclude from display" for fields.
-Only use "Rewrite the output of this field" to modify that particular field only and don't use other field replacement patterns
-Use the Semantic Views module to define the row style. Set the Row style as "Semantic Views : Fields". In "Row style options" remove any elements information, to combine all fields into a single text element.

erikjohansson’s picture

Just chiming in to say that I have the same issue with the CSV export option. The default view which is a table works fine, but the CSV doesn't. It's like the excluded fields of the first row gets cached and then reused for the same excluded fields in the rest of the rows.

Thing is, I didn't always have this problem, it just suddenly popped up after some fields were edited.

DarrellDuane’s picture

I'm still seeing this problem, I've now upgraded to Views-6.x-3.x and it is still happening. Any ideas?
I attempted to fix it by changing

 if( empty(!$fields[$id]->options['exclude'] ) ){ 

to

 if(  !$fields[$id]->options['exclude'] ) {

in views_bonus_export.module since
$fields[$id]->options['exclude'] was equal to 1 for excluded columns, but it didn't fix anything.

neclimdul’s picture

Issue summary: View changes
Status: Active » Closed (outdated)