Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I had the exact same issue of sending UTF8 data to Excel. My solution:</p> <p>The current version of the Perl Spreadsheet::WriteExcel cpan code correctly writes Excel files using UTF8 data.</p> <p>So I wrote a Rails plugin that a) opens a two-way pipe to a perl program b) sends the data, a row at a time, to the perl program. I use Yaml as the message data format. (Standard Ruby yaml is not UTF8, there's a special version available, ya2yaml) c) The perl program creates the excel file d) When the Rails program indicates (via a yaml message) that the last row has been sent, the perl program creates the excel file and sends the status back to the rails program.</p> <p>Of course, adding a perl program to a rails project via a parallel process and a pipe is very much in the "Engineering" spectrum rather than "Computer Science." (It gets the job done but is not elegant.) But it does work well and saved me the weeks it would take to port the WriteExcel code to Ruby. Also note that the currently available Ruby port of WriteExcel does not handle utf8. </p> <p>My sw is permissive open source but I haven't gotten around to releasing it yet. If you want it in its current state, see <a href="http://sandbox.kluger.com/write_excel_v.5.tar" rel="nofollow noreferrer">http://sandbox.kluger.com/write_excel_v.5.tar</a></p> <p>Note that you'll want to create your excel files in a background process, not in the process of the Rails controller since that would block other browser clients as you grind away producing the excel file. I use DelayedJob plugin, works well.</p> <p>Hope this helps,</p> <p>Larry</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload