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
115
UltraWebGridExcelExporter and CSS styles
posted

Hi Infragistics gurus,

A question for you... If I have an UltraWebGrid where the styles are set on the elements themselves (eg. setting properties for the various RowStyleDefault values), then when I export that grid through UltraWebGridExcelExporter.Export() those styles are preserved in the resulting Excel file. This is a nice feature - it means the style of the Excel file matches the style of the grid displayed on the web page.

However, if I apply those same styles to the grid elements via CSS (eg. <RowStyleDefault CssClass="myRowStyle" />), these styles are not preserved in the resulting Excel file, even when exporting via the same process. Therefore the Excel file no longer looks like the grid rendered on the web page. Why not?

I understand that CSS files are only applied to the elements during rendering by the browser (client-side), however surely you should be able to utilise the same server-side processes used to export the grid to apply the styles, regardless of how those styles are specified? CSS is a very popular web standard, the Excel exporter should support it... Infragistics users should not be forced to choose between either (a) applying web design best practices to the website, and having an ugly Excel export; or (b) have the Excel export match the rendered grid, and have to avoid using CSS & hard-code the styles instead.

Obvious workaround: implement your own CSS-styling exporter, pass the grid datasource to it, iterate through the datasource building your own workbook with the CSS styles as you go, then do a custom export... really that is many days' worth of extra coding on the server side, to work around functionality that appears to be missing from the Infragistics control - and in the control is where it belongs, the code to do all this would be common to all applications.

For the record, I'm using 7.1.20071.40. If this is fixed in a later version, or I have missed something obvious, please let me know.

Cheers,

 - Sam.