I'm not sure how this module is supposed to behave....but I don't think it's working right for me...

Should a CSV button be shown on all views?

I do see that in the views configuration page (View Type drop-down), you can set the type to "Views Bonus: CSV file" but when I set it to that, and then go to my view, it just attempts ad downloading a the file instead of showing me the view.

AND, the file it does download doesn't have any of the data fields in it....attached is the file I get.

Something seems like it's not working how it should be.

CommentFileSizeAuthor
view-36.csv_.zip1.32 KBmdowsett

Comments

mdowsett’s picture

please....someone help!?!

alpritt’s picture

You need to set an argument in your view. Select 'CSV: CSV File Selector' from the argument dropdown list and add it. Then in the 'default' column for that argument select 'Display all values'

mdowsett’s picture

MANY, MANY thanks for your help. I've done what you said above and it isn't quite working....

I cloned a View that I have working that is a table view with the fields I want to download. I then made the setting changes you mentioned. When I go to that new view, I get a comma separated list of all the desired fields...but it's in the browser - I was guessing I'd get a similar view as my original with a 'CSV' button at the bottom to download it all to a CSV file...should I have?

I also tried right-clicking the URL from my list of views and choose "Save Linked File to Desktop" and what I get is an HTML file (not CSV) that has so unexpected lines at the top of the file that read:

** and then the last two lines above repeat for every user that is in the view (all 750 users)....and THEN it lists all their desired data fields

I tried changing the view type to DOC as well and get the same results.

So, since I don't know what to expect from how this module is supposed to work, I can't tell if it's not working right or if I'm doing something wrong. I hope you can shed some light.

I was even hoping that since I have some filters set up to filter which records are shown in this specific view, you could filter the list prior to downloading the CSV file and it would only download the filtered list....am I dreaming or should this work as well?! :)

I really appreciate your help on this.

alpritt’s picture

What you are expecting is indeed what you should be seeing.

What do you have the view type set as? There are options to set this as a 'Views Bonus: CSV file', but you don't want to do that if you are setting an argument. So make sure you keep this setting as 'Table View'.

mdowsett’s picture

Progress! Yahoo!

It doesn't make sense why you would set it to table...but whatever works.

So I do get a viewable view with the CSV button at the bottom.

BUT, the button takes me to an HTML page in my browser with the data scattered (CSV separated) instead of downloading it.

I also tried right clicking on the CSV button to download the attached file but it downloads the .htm file.

I also tried filtering the view and then clicking on the CSV button in hopes it would only show the filtered data...but no luck.

Any OTHER ideas?

alpritt’s picture

It is set to table view because when you go to the url for your view (example.com/my-view) you still want to see your view presented as a table. It doesn't have to be table view, it could be list view, or node view, etc; but if you set it as CSV example.com/my-view would automatically download the CSV file. You sound like you don't want that. You want the normal table view with a csv button at the bottom.

I note above that you say you cloned another view. If you are using arguments you don't really need to do this unless you want to change something like the field labels so that they are different to the view as it is presented on your site. What happens with arguments is example.com/my-view would present the view normally, but example.com/my-view/csv would present the CSV file. Adding the /csv argument to the url makes that one alteration to the view. Not having it, presents the view normally.

Hope that makes sense.

Not sure why it would be presenting it as an HTML page. Maybe attaching the resulting document to this issue might help because I'm not totally clear what you are getting.

mdowsett’s picture

can I email it to you directly? It'd have a lot of users addresses and I don't wish to post it for the world to see.

alpritt’s picture

Sure. My email address is on this page http://humte.com/contact

alpritt’s picture

Okay, received your email. I'll respond here to keep the issue in public where possible.

First step would be to upgrade to the new alpha 2. Let's see if that fixes any issues.

If not, we need to work out how to recreate the problem. Create a new test site and install views and views bonus. Add a load of test data (devel module will help) and then create a view out of some of these test nodes. Add the CSV as an argument for that view and see if it works as you would expect.

If all is good, the next step would probably be to install bio module as this is appearing as random text at the top of the csv file. Check the csv again. If no problem still, add some fields from bio module to the view and check again. If not, add cck. Then cck address field.

Then detail how to recreate the problem and I'll try to replicate it on my machine.

alpritt’s picture

Also try clearing your views cache at example.com/admin/build/views/tools.

mdowsett’s picture

I think you are on to something...

I updated the Views Bonus, cleared the cache and tried the download again. It did download it as a CSV file right off the bat (no right clicking/save-as).

The file still seems to reference a bunch of Bio info. I have always had the Bio, CCK and CCK address modules installed, configured and in use. The file downloaded now does seem to have all the users' info...and all users, not just the first 40 but it is mixed in with lines of 'random data' as you term it that seems to still relate to the Bio module.

Any suggestions? I can't remove the Bio module as this view is all based on that data.

Thanks for your help and sorry for not responding quicker.

alpritt’s picture

Title: no CSV button... » CSV export contains random data
Version: 5.x-1.2-alpha1 » 5.x-1.2-alpha2

I tried to recreate the error with bio module and cck address and couldn't; which makes this a little difficult to debug.

Try creating a brand new view without any of the cck fields in it, just normal nodes. Add the csv as an argument again, and see if the bio data is still in the file. If not, we have a starting point.

mdowsett’s picture

Status: Active » Closed (fixed)

I finally got around to this (I actually forgot about it...mainly in frustration).

I did recreate a new View...great idea. It did work.

I removed the user picture field in the view that wasn't working and that fixed it. I will try adding it back in when the site goes live...I'm working on an upgraded (4.7 to 5.7) development site and I think the errors rise from not all the user images being there.

I'll either get it working with or without the pics, it's not critical.

MANY thanks - sorry I wasted your time.