Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
710
WinGrid to Excel - keeping the format?
posted

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

UGEE.Export(Me.UltraGrid_Results_1, ReportName_XLS)

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("A", GetType(Double))

.Add("B", GetType(Double))

.Add("C", GetType(Double))

.Add("D", GetType(Double))

.Add("E", 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"

End With

My issue is that every column when exported to Excel displays ALL DECIMALS...

Thanks in advance!