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.
Unfortunately, activation email could not send to your email. Please try again.

Save as csv in xlsIO

Thread ID:

Created:

Updated:

Platform:

Replies:

107775 Mar 16,2013 11:54 AM Mar 19,2013 06:44 AM WPF 2
loading
Tags: XlsIO
Gary Pansino
Asked On March 16, 2013 11:54 AM

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 11:59 AM

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 06:44 AM

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.

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.

;