Hi,
I have a ultraWingrid and I export the data from the grid to an Excel file using the UltraGridExcelExporter
Everything works find but I still have a little problem
In the ultraWingrid the header background is Blue and the font color is white
When I export the data to an excel file the name of the header is exported but the font color is white.
So we don't see the name of each column :(
So we think that the name of each column is not exported which is not the case. The problem is just that the font color is white. Is there a way we can change the font color before exporting the data or after or change the backgroud color of the header in the excel file.
Because the user that export the data always think that the name of each columnis not there.
You have to know that all the ultraWingrid and form in my application use a template for color so the application look the same in every form.
Thanks in advance and have a nice day
The colors and styles provided by an Application Style Library will override any run-time property settings by default.
So there's no way to programmatically turn these off.
What I recommend is that you create a new UltraWinGrid in code and set UseAppStyling on the grid to false. Then you can bind this grid to the same data source as your real grid. You can use grid.DisplayLayout.CopyFrom to copy the layout of your real grid into this new grid. You might also want to hook up the new grid to some of the same events are your real grid, like InitializeLayout and InitializeRow so that the new grid has the same layout. Then you can export the new grid to Excel.
Hi, Im having similar issue but in my case I have the Noire Style but I want to turn it off when I export to excel. I want to have normal Black Font with White Background. I have tried overriding layout cell appearance without success.
Any clue?
Thanks in advance
Thank you very much for your answer.
I try what you explain me and it work out :)
I appreciate your help and I want to tell you that you are doing a very good job for us all the programmers
I wish you a nice day!
Okay, mystery solved. The reason Excel isn't picking up the colors is that no colors are applied but this isl file. It's coloring the headers in the grid by using an image, and Excel doesn't support cells with background images.
Open up the isl file in AppStylist and go the Header->GridHeader->GridColumnHeader role. Here you can see what settings are applied to the column header. Notice that on the Background chunk, Solid i selected and the selected color is Transparent. Also notice that there's a Resource applied on the Resources chunk. The resource is supplying the image which provides the blue gradient background. This was probably done using an image so that the image can provide the 3d borders.
Anyway... Excel cannot pick up the image from the on-screen grid, so it just uses the color - which is transparent. There's no reason why the color on this role should be transparent, since the image is covering the entire background on the screen, anyway. So the easiest way to fix it is to simply select a solid blue color that matches the background image.