reasoncorp / dossier

Ruby-based report generation/presentation Rails engine.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in XLS file format???

mattslay opened this issue · comments

2013-02-10_22-20-36
2013-02-10_22-18-57
When I call for the XLS format, it downloads a file to my Downloads folder, but when I try to open that file with Excel 2010, I get this error message:

"The file you are trying to open, 'test-report_02-10-2013_22-07-06.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"

(I'm developing the Rails app on a Mac, but my users will be using Excel on a Windows machine to view this spreadsheet.)

If I click on YES, the file actually does open up just fine, so I guess it's no great issue, however, I can see that this could be very concerning to some users.

I also tried opening the file on my Mac using Libre Office, but I also get an error:
"General Error. General input/output error."

However, Libre Office is not as forgiving as Excel, and it on has an OK button for that error message, and it does not open the file.

Matt,

Thanks for pointing this out.

We are currently generating the excel format manually, and apparently it's harder than it originally seemed to do it in a way that makes Excel happy.

We have on our roadmap the goal of switching to using the roo gem for this. It would support more output formats and probably would do a better job with Excel, too.

If you want to take a crack at it, that would be great. If not, this issue will serve as one more reason for us to get around to converting soonish.

RailsCasts (Ryan Bates) has a nice video on Excel exporting.

http://railscasts.com/episodes/362-exporting-csv-and-excel

I'm not sure if anything in that video would be of help or not. I don't think my current skill level qualifies me to be of much help. I'm a good tester, but that's about all for now.

P.S. I added a comment on that video pointing here as an alternate way of exporting CSV, Exce, JSON, and HTML.