How can I set the format of cells using VB.NET (2003)

Technical support for Spire.DataExport

Moderators: iceblue support, DataExport, Manager

How can I set the format of cells using VB.NET (2003)

Postby netdzynr » 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.

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

Postby DataExport » Thu Sep 14, 2006 12:35 pm

Hello,
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

support@e-iceblue.com
DataExport
 
Posts: 35
Joined: Thu Jun 29, 2006 2:29 pm


Return to Spire.DataExport

Who is online

Users browsing this forum: No registered users and 0 guests