Hi there,
I wonder how I can keep the original UGrid format when exported to Excel?
I just use the following,code maybe there is something to consider?
Dim UGEE As New Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter
System.Diagnostics.Process.Start(ReportName_XLS)
I mean, witout using any event to perform a manual formatting, since I want the Excel as the UGrid already is.
The UGrid columns are formatted during a previous init routine
With Me.UltraDataSource_Results_1.Band.Columns
.Add("B", GetType(Double))
.Add("D", GetType(Double))
.Add("F", GetType(Double))
End With
With Me.UltraGrid_Results_1.DisplayLayout.Bands(0)
.Columns("A").Format = "0000"
.Columns("B").Format = "0000.0"
.Columns("C").Format = "00.000"
.Columns("D").Format = "0000.0"
.Columns("E").Format = "00.00"
.Columns("F").Format = "0000.0"
My issue is that every column when exported to Excel displays ALL DECIMALS...
Thanks in advance!
Any ideas?
Please, any help is really needed and most appreciated!
Thanks in advance.
DotNet formatting and Excel formatting are not always the same. So the UltraGridExcelExporter can't just take the format you are using in the grid column and copy it directly into Excel, since it might not be valid.
Mike, thanks again for your great help. It worked!
Here is my code
Dim WithEvents UGEE As New Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter
Private Sub UGEE_InitializeColumn(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.ExcelExport.InitializeColumnEventArgs) Handles UGEE.InitializeColumn
e.ExcelFormatStr = e.Column.Format
End Sub