Spread Silverlight Documentation
Spread Silverlight Documentation / Developer's Guide / Managing Data / Exporting to HTML
In This Topic
    Exporting to HTML
    In This Topic

    Cell values, cell style information, spans, multiple headers, grid lines, grid line colors, and the control theme are saved to the HTML file.

    The file contains the area down to the last cell with data.

    The column width may be expanded in order to display all the text in the cell. Hidden rows and columns are also hidden in the HTML file.

    Sparklines, group bars, the filter button, the sheet corner arrow, and the tab strip are not exported. Cell word wrap, cell overflow, frozen rows and columns, active cell outline, and the zoom option are also not exported.

    If there are multiple viewports, the default viewport is saved.

    You can use the SaveHtml method in code to save to an HTML file.

    Using Code

    The following example uses the SaveHtml method to save the sheet to a file.

    CS
    Copy Code
    gcSpreadSheet1.Sheets[0].ShowGridLine = true;
    gcSpreadSheet1.Sheets[0].GridLineColor = Color.FromArgb(255, 150, 25, 199);
    gcSpreadSheet1.Sheets[0].Cells[0, 0].Text = "test";
    SaveFileDialog saveFileDialog = new SaveFileDialog();
    saveFileDialog.Filter = "Html File (.html)|*.html";
    bool? useClick = saveFileDialog.ShowDialog();
    if (useClick == true)
    {
        var stream = saveFileDialog.OpenFile();   
        gcSpreadSheet1.Sheets[0].SaveHtml(stream);
        stream.Dispose();
    }
    
    VB.NET
    Copy Code
    GcSpreadSheet1.Sheets(0).ShowGridLine = True
    GcSpreadSheet1.Sheets(0).GridLineColor = Color.FromArgb(255, 150, 25, 199)
    GcSpreadSheet1.Sheets(0).Cells(0, 0).Text = "test"
    Dim saveFileDialog = New SaveFileDialog()
    saveFileDialog.Filter = "Html File(.html)|*.html"
    Dim useClick As Boolean = saveFileDialog.ShowDialog()
    If (useClick = True) Then
        Dim stream = saveFileDialog.OpenFile()
        GcSpreadSheet1.Sheets(0).SaveHtml(stream)
    End If
    
    See Also