Skip to main content Skip to footer

GrapeCity Spread Silverlight CTP, Part 9 - CSV Import and Export

Spread CTP - Script 9: CSV Import and Export

If you are interested in downloading the Spread CTP, please email labs@grapecity.com .

This is the 9th in a series of Spread CTP Blogs and is a continuation of:

Part 1 : Create an app from scratch
Part 2 : AutoFit
Part 3 : Borders and Grid Lines
Part 4 : Cell Format
Part 5 : Cell Overflow
Part 6 : Cell Span
Part 7 : Clipboard Operation
Part 8 : Conditional Formatting

GcSpreadSheet has additional settings that are available when saving or loading CSV files. You can only save or load text, include row or column headers, save or load unformatted values, export or import formulas, and set the encoding.

Using Code

CS

string fileName;
fileName = "..\..\\bin\\savespreadstream.csv";
System.IO.Stream stream;
stream = System.IO.File.Create(fileName);
gcSpreadSheet1.Sheets[0].SaveCSV(stream, GrapeCity.Windows.SpreadSheet.Data.CSVExportFlags.AsViewed);

or

System.IO.Stream stream;
stream = System.IO.File.Open("D:\\SpreadFiles\\file01.csv", System.IO.FileMode.Open);
gcSpreadSheet1.Sheets[0].LoadCSV(stream, GrapeCity.Windows.SpreadSheet.Data.CSVImportFlags.None);

VB.NET

Dim fileName As String
fileName = "..\bin\savespreadstream.csv"
Dim stream As System.IO.Stream
stream = System.IO.File.Create(fileName, System.IO.FileMode.Create)
GcSpreadSheet1.Sheets(0).SaveCSV(stream, GrapeCity.Windows.SpreadSheet.Data.CSVExportFlags.AsViewed)

or

Dim s As New FarPoint.Win.Spread.Model.SpreadSerializer
Dim stream As System.IO.Stream
stream = System.IO.File.Open("D:\SpreadFiles\file01.csv", System.IO.FileMode.Open)
GcSpreadSheet1.Sheets(0).LoadCSV(stream, GrapeCity.Windows.SpreadSheet.Data.CSVImportFlags.None)

Part 10 Data Binding

Spread, Excel, Silverlight, CTP, labs@grapecity.com , visual studio, AutoFit, borders and Grid lines, cell format, cell overflow, cell span, clipboard, clipboard operation, conditional formatting, CSV, CSV Import and Export

tweetmeme_url = 'http://www.clubfarpoint.com/Forums/blogs/russells\_blog/archive/2012/03/28/grapecity-spread-silverlight-ctp-part-9-csv-import-and-export.aspx'; tweetmeme_source = '@russcamtv'; tweetmeme_hashtags = '#appdev';

MESCIUS inc.

comments powered by Disqus