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
520
Exported ExcelSheets have bad format
posted

Hi,

 I'm using the UltraExcelExporter to generate Sheets for an excel report. The informations I want to report are stored in datatable. So I load them to an ultrawingrid and then export them to excel using the excelexporter. The fore- and backcolors of the header- and summary cells really look bad (red textcolor on a black bachground in the header or black textcolor on a dark blue backcolor!!). And also the lines of the grid/cell are missing!

The code I use looks like this

Dim oExcelExporter As New Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter
Dim oWS As Infragistics.Excel.Worksheet = oExcel.Worksheets.Add(Guid.NewGuid.ToString)

Dim oTempGrid As New Infragistics.Win.UltraWinGrid.UltraGrid
If Not IsNothing(oStatement.RBEPlusValue) Then
                        oWS.Rows(iRowCount).Cells(iColCount).Value = oStatement.name
                        iRowCount += 1
                       oTempGrid.DataSource = oStatement.RBEPlusValue   ' Comment: oStatement.RBEPlusValue TypeOf datatable

                       oExcelExporter.Export(oTempGrid, oWS, iRowCount, iColCount)

                        iRowCount += oTempGrid.Rows.Count + 2
                    End If
                    oTempGrid.Dispose()

The resulting excel find attatched !

Thanks for any help!

Cheers,

Michael 

BadFormatedExcel.zip
Parents
No Data
Reply
  • 520
    Verified Answer
    Offline posted

     Hi,

     I have some additonal information about the strange behaviour. The problem occures when you copy a worksheet generated by the ultragridexcelexporter to another workbook. The copying process doesn't copy the colors and formats correctly (see attachment). So I think the problem is related to Excel and not to the ultragridexcelexporter.

     

    Cheers

    Michael 

    ExcelColors Sample.zip
Children
No Data