UPDATED:
Starting with version v2015 vol 2 (v15.2), this functionality is available out of the box. Use ASPxGridView.FormatCondition rules to define conditional formatting in Browse Mode and keep the applied appearance in the Exported Document. Please refer to the ASP.NET Grid View - Data Range Filter, Adaptivity and More (Coming soon in v15.2) blog post and the Export with Format Conditions demo for more information.
If you have version v15.2+ available, consider using the built-in functionality instead of the approach detailed below.
If you need to apply custom appearance in the Exported Document only or define fine tuned complex appearance (for instance, based on some runtime calculated values, custom business rules, etc.), use the ASPxGridViewExporter.RenderBrick event in the WYSIWYG export mode.
See Also:
T262239: ASPxGridView - How to export a colored grid when the Data Aware export mode is used
Question Comments
Added By: Smitha at: 5/30/2014 9:37:00 AM
But how do I make the font to bold and also underline the text. If I do , it doesn't work. I get the error that the property is a read only one.
e.BrickStyle.Font.Bold = true;
e.BrickStyle.Font.Underline = true;
Hello,
I have created a separate ticket on your behalf to process your inquiry more effectively:
How to change font's Bold and Underline properties when export the colored ASPxGridView
Please refer to it for further correspondence.
Hi , how can I set background color for detail grid while exporting? I am exporting master detail grid using PrintingSystem I am able to set background color in master as well as detail grid but not reflected when exported.
ref: https://www.devexpress.com/Support/Center/Question/Details/T184373
Please let me know if you need any further information.
Thanks
Nirav
Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T199648: How to export the colored master-detail ASPxGridView using PrintingSystem. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
So I´m trying to do this:
//LoadReportQUERY();
//ASPxGridViewExporter1.DataBind();
//ASPxGridViewExporter1.WriteXlsxToResponse(.....);
And I´ve worten the method:
protected void ASPxGridViewExporter1_RenderBrick1(object sender, ASPxGridViewExportRenderingEventArgs e)
{
//if (e.RowType == GridViewRowType.Header || e.RowType == GridViewRowType.Group)
//{
// e.BrickStyle.BackColor = Color.DarkRed;
//}
}
But my excel remains without colors when exported.
Who can I aply some colors to my exported file?
thanks in advance.
Added By: Alessandro (DevExpress Support) at: 7/7/2016 7:20:29 AM
Hello,
I've created a separate ticket on your behalf (T400875: ASPxGridView - The RenderBrick event have no effect). It has been placed in our processing queue and will be answered shortly.