CsvHelper icon indicating copy to clipboard operation
CsvHelper copied to clipboard

On same clients machine I get extra ,,,, at the end

Open benaichouchem opened this issue 10 years ago • 6 comments

On Some clients machine, instead of getting the header (and all the other lines) just like this:

Name;Id;Cost;Price;CurrentQuantity

I get this

Name;Id;Cost;Price;CurrentQuantity,,, `` Any ideas? I am unable to reproduce locally.

benaichouchem avatar Jul 23 '16 23:07 benaichouchem

Edit: Info asked for here didn't apply.

tamusjroyce avatar Jul 24 '16 03:07 tamusjroyce

We use CsvHelper in our web app to allow them to download their data. I don't have this issue when I try to reproduce it. What kind data should I paste?

benaichouchem avatar Jul 24 '16 03:07 benaichouchem

Web app was the information not given. I'm assuming asp.net? or rest (like owin / katana or wcf)? I'm not as familiar with those as I should be. My guess would be whatever is streaming the .csv isn't in binary mode (Octet-stream). Or maybe it is browser specific? Maybe installing the same browser w/ same version #, or impersonating the user having issues would get the error to reproduce.

Sorry for not being of more help. I will let someone else that might have an answer do so.

tamusjroyce avatar Jul 24 '16 05:07 tamusjroyce

Thanks @TamusJRoyce . Yes it is Asp.Net MVC. I tried with IE, Chrome. The user complains that he sees it with all browser. I am suspecting more a Culture issue.

MemoryStream stream = csvExporter.EportTake(take, _context);

        var filename = "take.csv";
        var contenttype = "text/csv";
        Response.Clear();
        Response.ContentType = contenttype;
        Response.AddHeader("content-disposition", "attachment;filename=" + filename);
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.BinaryWrite(stream.ToArray());
        Response.End();

benaichouchem avatar Jul 24 '16 14:07 benaichouchem

Can you see what the CSV data is before it's put through the response?

JoshClose avatar Jul 27 '16 16:07 JoshClose

HI @JoshClose client can't reproduce this issue. And was never able to reproduce it. I will close the issue

benaichouchem avatar Jul 27 '16 17:07 benaichouchem