Views Export. Export .csv or .doc file empty
josedazag - August 26, 2007 - 00:06
| Project: | Views Bonus Pack |
| Version: | 5.x-1.x-dev |
| Component: | Views Export |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
Hello everybody.
I have installed View Bonus Pack module in Drupal 5.2. I have configured permissions for required roles to export views. However, when i create a view to show any data and select csv icon to export them, the resulting file is empty.
Please help me. Perhaps i have forgotten to activate some parameter, or i did not follow something procedure.
I did test views_bonus-5.x-1.2-alpha1.tar.gz and views_bonus-5.x-1.x-dev.tar.gz release.
Sorry by my english. Thanks for any help. This module it is very important for my site.

#1
A few things to troubleshoot: Does your view actually contain any data? What browser are you using (test in Firefox, IE7, Safari)?
#2
Hello Rob Loach. Thank you by your help.
Yes, my view shows data and contains in this case two nodes of a content type defined by me. I did export data with IExplore 6.0 and Opera 9.21.
#3
If you view the exported view source, do you see the CSV data?
#4
Hello Rob.
I understand that CSV data exported from view source, I found it in menu item Export of Actions column in Administer views page. However, this source don't contains anything references to my view data, only to page title, url and content type. I have targzipped, titled and attached several screenshots related with view. Perhaps they are of more aid.
Thank you
#5
Here they are the other screens
#6
Here they are the other screenshot
#7
Oh, we mean when you look at the view itself, with the CSV or DOC arguments being part of the view, you should be able to see export buttons at the bottom... You should also be able to visit myview/csv to get the CSV file.
#8
Yes. Previously already it had proven adding CSV or DOC arguments as part of the view. I see export buttons at the bottom. Too i was also be able to visit myview/csv to get the CSV file. However, the downloaded file is empty.
I attach screenshot of my view with argument CSV and default option like Display all values and too empty .csv file. There is not problem with permissions because at time i work with Drupal Administrator User.
#9
Another screenshot
#10
I've got the same problem. View works fine, click on CSV link and get an empty CSV file.
#11
Can you attach an export of your view? I think the original posters problem was they didn't not have fields attached to their view and csv export actually requires there to be fields.
#12
Weird that you guys commented today after more than a year of silence on this node :)
I have the same thing; my view works, has fields defined and so forth; when I add /csv to my url I get a proper CSV file with all the content.
However, I have added the CSV: CSV File Selector Argument, and chosen "Display all Values" as the Default. All other fields empty. This *sometimes* gives me results (it gave me a good CSV file immediately after I added another field to the view, but I can't replicate this behaviour a second time), but as of now it's not working at all.
For those of you with this problem, perhaps you're just trying to move content forward to a Drupal 6 site... that's what I'm doing, so I would suggest you just use the /csv url to get your data out. Hopefully that's good enough for you as well.
Jeff
#13
@jeff h is it possible you could post an export of your view as well? if there's something I can do to fix it I might as well.
#14
Hi,
I'm having similar issues in D6, but it seems related to whether the View requires arguments or not. Seems the Bonus Export stuff does not support arguments? I'll give you my use case. I want to use Views to provide a Word doc version of a node. (I can code it easily enough, so it's no biggy if it doesn't work, but if Views can do this then great!) So I created a view called node_to_word, gave it a feed with a style of DOC and an argument of node ID and asked it to display empty text if no valid nid was provided. Result? Page works fine but attached DOC feed produces an empty document.
View export (Drupal 6, Views 2) is attached, but I would not be surprised if the issue were identical for Drupal 5, Views 1. Perhaps someone can confirm/deny if this is the case? =)
#15
+1 subscribing
#16
I just reported a similar issue at #495336: XML feeds over Excel uses IE.
Could some of you verify whether this related to your browser? I.e., does loading the CSV produce different results in IE or Firefox? My experience is IE creates missing fields, but Firefox always gets the data.
#17
Definitely *not* browser-related in my case. 99% sure it's just the arg getting dropped, and so blank doc returned.
#18
I am not getting a word document file download popup from my browser when I add a template file to the mix for word documents. It happens even when the added template file is an exact copy of the default 'Style output:' template file for the document view. I have copied the file modules/views_bonus/export/views-bonus-export-doc.tpl.php to themes/theme_name/views-bonus-export-doc--view_name.tpl.php
I am using the patched version of views_bonus http://drupal.org/node/444412
One other quirk that I've noticed is that the variables that are available to the template files in
modules/views_bonus/export/*.tpl.php are not available to the templates that are created in themes/theme_name/*.tpl.php such as $themed_rows and $table. Anyone know if there is a way to make these variables accessible to contributed template files for views_bonus ?
#19
I have tested this problem further and used a different theme (Garland), as well as using CSV file download, and
I get the same blank white screen in my browser if I am overriding the theme's .tpl.php file with exactly the same file.
In this case I copied views-bonus-export-xls.tpl.php to my theme's directory and renamed it to
views-bonus-export-xls--user-list.tpl.php, and rescanned my system for theme files, which found this file.
When I go to view the xls file, it gives me a white screen instead of popping up a user interface to download the xls file.
#20
Any idea how I'd go about debugging this? I tried with firebug but firebug doesn't seem to pick up on file download popup windows. I did view the HTML from firebug and just saw the beginning and ending tags associated with a page on the white screen.
#21
Please don't steal issues.
#22
Sorry about that, was trying to avoid creating a new issue. As it turns out, I'm not getting this error at the moment, it seems to have resolved itself.
#23
I had the same problem with the 6.x-1.0-beta4. Since it worked with 6.x-1.0-beta1 I rolled it back, and now it works again. Hence, the bug is introduced in beta 2, 3 or 4.
#24
We have fixed the problem in 6.x views_bonus by hardcoding a:
drupal_set_header('Content-Type: application/msword');
into the beginning of the tpl.php file. It doesn't address the problem, but it fixes it.
We also found a nice tool to debug this problem:
http://livehttpheaders.mozdev.org/
#25
This means your preprocess functions aren't running for some reason. Try running update.php after updating the module.
#26
I found another funny issue related to this one. My DOC files and CSV files were coming up, and they have their header in them, but they weren't showing any data. It turned out that having a VID field at the end of the list of fields to display (which was configured as "Exclude from display") was causing the data not to appear. I'll have to see if I find anything more to the pattern, I don't know if it was just the VID that causes it or just having any field that has "Exclude from display"
#27
#593336: Views requires a theme include
#28
http://drupal.org/project/cvs/75371 should fix this. Anyone want to make sure it solves it for them?
#29
err meant to set it for review when i asked for review....