We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Save as csv in xlsIO

Thread ID:

Created:

Updated:

Platform:

Replies:

107775 Mar 16,2013 03:54 PM UTC Mar 19,2013 10:44 AM UTC WPF 2
loading
Tags: XlsIO
Gary Pansino
Asked On March 16, 2013 03:54 PM UTC

When I use your online instructions, I am getting an error "Argument 1: cannot convert from 'Windows.Storage.StorageFile' to 'System.IO.Stream' when trying to save a sheet (shData) as a csv.

var saveMain = await ApplicationData.Current.LocalFolder.CreateFileAsync("Test.csv", CreationCollisionOption.ReplaceExisting);
await shData.SaveAsAsync(saveMain, ",", Encoding.UTF8); 

Any advice?

Thanks.

Gary Pansino
Replied On March 16, 2013 03:59 PM UTC

I had also tried  shData.SaveAs(saveMain, ",", Encoding.ASCII); and both SaveAs and ASCII are not recognized as keywords.

Manoj Kumar G M [Syncfusion]
Replied On March 19, 2013 10:44 AM UTC

Hi Gary Pansino,

Thank you for choosing Syncfusion products.

Currently we don’t have support for passing  StorageFile as an argument for saving CSV files. Please use the following code snippet to achieve the above scenario.

Code Snippets:

StorageFile storageFile = await ApplicationData.Current.LocalFolder.CreateFileAsync("Test.csv");

            await sheet.SaveAsAsync(await storageFile.OpenStreamForWriteAsync(), ",", System.Text.Encoding.UTF8);

 

Please let us know if you any further clarifications.

Regards,

Manojkumar.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;