Spire.DataExport for .NET is a 100% pure data .NET library suit for exporting data into MS Word, Excel, RTF, Access, PDF, XPS, HTML, XML, Text, CSV, DBF, SYLK, SQL Script, DIF, Clipboard, etc.

Wed Sep 13, 2006 6:13 pm

I am using the dataexport control and it's working just fine. However, I need to set the format of cells in the spreadsheet I am exporting to.

I have found an example of how to do this in C# but need a VB.NET example.

Can you provide one? I am trying to force the cell to a TEXT format instead of "general" which is the default.


Posts: 1
Joined: Wed Sep 13, 2006 6:09 pm

Thu Sep 14, 2006 12:35 pm

You need to write code in GetDataParams event.
Try to use the following example code,

Code: Select all
Private Sub CellExport1_GetDataParams(ByVal sender As Object, ByVal e As Spire.DataExport.EventArgs.DataParamsEventArgs) Handles CellExport1.GetDataParams
        If e.Col = 1 Then
            e.FormatText = "dd/MM/yy"
        End If
 End Sub
Technical Support
Spire.DataExport Team


Posts: 35
Joined: Thu Jun 29, 2006 2:29 pm

Return to Spire.DataExport