Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output widget export to CSV - Excel 'ignores' \n ?? #845

Closed
smudgester opened this issue Mar 13, 2015 · 4 comments
Closed

Output widget export to CSV - Excel 'ignores' \n ?? #845

smudgester opened this issue Mar 13, 2015 · 4 comments
Labels

Comments

@smudgester
Copy link

Hi Mottie,

I have been using your fork a while and am now trying to get the output widget working on my site.

I am using the following code:

        $("table.download").tablesorter({
            widthFixed : true,
            widgets: ["output"],
            ignoreCase: false,
            widgetOptions : {
                output_separator            : ',', 
                output_ignoreColumns        : [], 
                output_dataAttrib           : 'data-name', 
                output_headerRows           : true,  
                output_delivery             : 'd', 
                output_saveRows             : 'a'
                output_duplicateSpans   : false,
                output_replaceQuote         : '\u201c;', 
                output_includeHTML          : false, 
                output_trimSpaces           : true, 
                output_wrapQuotes           : true, 
                output_popupStyle           : 'width=580,height=310',
                output_saveFileName         : 'optionsandchoices_report.csv',
                output_saveElement  : "#assignInfo",
                output_callbackJSON  : function($cell, txt, cellIndex) { return txt + '(' + cellIndex + ')'; },
                output_callback      : function(config, data) { return true; },
                // the need to modify this for Excel no longer exists
                output_encoding      : 'data:application/octet-stream;charset=utf8,'
            }
        });

        $('.reportView button.download').click(function(){
          var $table = $(this).siblings('table.download');
          $table.trigger('outputTable');
          return false;
        });

My download button generates the CSV file correctly and I can see \n where expected. However, when I try to open the file in Excel (either via File -> Open or double-clicking on the file) the \n's are still there and haven't been replaced with ALT+ENTER.

Any ideas ?

@Mottie
Copy link
Owner

Mottie commented Mar 13, 2015

Hi @smudgester!

Hmm, yeah I'm seeing this problem too... I know it was working properly before. Did they change Excel or something?

I'll investigate and hopefully find a solution. Thanks for reporting this issue!

@Mottie Mottie added the Bug label Mar 13, 2015
@Mottie Mottie closed this as completed in 96b0bb7 Mar 13, 2015
@Mottie
Copy link
Owner

Mottie commented Mar 13, 2015

Ok, it should be fixed now!

@smudgester
Copy link
Author

Thanks - will give the latest version a try

@smudgester
Copy link
Author

Works perfectly. Thanks once again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants