GrapeCity.Xaml.SpreadSheet.Data
TextFileSaveFlags Enumeration
Example Example 


Specifies the export flags.
Syntax
'Declaration
 
<FlagsAttribute()>
Public Enum TextFileSaveFlags 
   Inherits System.Enum
'Usage
 
Dim instance As TextFileSaveFlags
[Flags()]
public enum TextFileSaveFlags : System.Enum 
Members
MemberDescription
AsViewed Exports the cell text area including the visible rows and columns of filtered-in rows.
ExportFormula Exports formulas.
IncludeColumnHeader Includes column headers.
IncludeRowHeader Includes row headers.
None Exports with no special options.
UnFormatted Exports without formatting.
Example
This example uses the TextFileSaveFlags enumeration.
gcSpreadSheet1.Sheets[0].Cells[0, 0].Value = "test";
gcSpreadSheet1.Sheets[0].Cells[0, 2].Value = "test1";
gcSpreadSheet1.Sheets[0].Cells[1, 0].Value = "test2";
       
private async void Button_Click_1(object sender, RoutedEventArgs e)
        {
            try
            {
                var filePicker = new Windows.Storage.Pickers.FileSavePicker();
                filePicker.FileTypeChoices.Add("Text Files", new List<string>() { ".txt" });
                filePicker.SuggestedFileName = "New SpreadSheet File";
                Windows.Storage.StorageFile storageFile = await filePicker.PickSaveFileAsync();
                if (storageFile != null)
                {
                    using (var stream = await storageFile.OpenStreamForWriteAsync())
                    {
                        var fileName = storageFile.FileType.ToUpperInvariant();
                        await gcSpreadSheet1.Sheets[0].SaveTextFileRangeAsync(0, 0, 5, 5, stream, GrapeCity.Xaml.SpreadSheet.Data.TextFileSaveFlags.AsViewed, "\r", ",", "", System.Text.Encoding.UTF8);
                        //await gcSpreadSheet1.Sheets[0].SaveTextFileRangeAsync(0, 0, 5, 5, stream, GrapeCity.Xaml.SpreadSheet.Data.TextFileSaveFlags.AsViewed , "\r", ",", "");
                    }
                }
            }
            catch (Exception ex)
            {
                Windows.UI.Popups.MessageDialog dialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Error");
                dialog.ShowAsync();
            }           
        }
GcSpreadSheet1.Sheets(0).Cells(0, 0).Value = "test"
GcSpreadSheet1.Sheets(0).Cells(0, 2).Value = "test1"
GcSpreadSheet1.Sheets(0).Cells(1, 0).Value = "test2"

Private Async Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
        Try
            Dim filePicker As New Windows.Storage.Pickers.FileSavePicker()
            filePicker.FileTypeChoices.Add("Text Files", New List(Of String)() From {".txt"})
            filePicker.SuggestedFileName = "New SpreadSheet File"
            Dim storageFile As Windows.Storage.StorageFile = Await filePicker.PickSaveFileAsync()
            If storageFile IsNot Nothing Then
                Using stream = Await storageFile.OpenStreamForWriteAsync()
                    Dim fileName = storageFile.FileType.ToUpperInvariant()                   
                    await gcSpreadSheet1.Sheets(0).SaveTextFileRangeAsync(0, 0, 5, 5, stream, GrapeCity.Xaml.SpreadSheet.Data.TextFileSaveFlags.AsViewed, ChrW(13), ",", "", System.Text.Encoding.UTF8)
                   'await GcSpreadSheet1.Sheets(0).SaveTextFileRangeAsync(0, 0, 5, 5, stream, GrapeCity.Xaml.SpreadSheet.Data.TextFileSaveFlags.AsViewed, ChrW(13), ",", "")
                End Using
            End If
        Catch ex As Exception
            Dim dialog As Windows.UI.Popups.MessageDialog = New Windows.UI.Popups.MessageDialog(ex.Message, "Error")
            dialog.ShowAsync()
        End Try
    End Sub
Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         GrapeCity.Xaml.SpreadSheet.Data.TextFileSaveFlags

Requirements

Target Platforms: Windows Server 2012, Windows RT

See Also

Reference

GrapeCity.Xaml.SpreadSheet.Data Namespace

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options