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
60
Formatting Column and Footer Row Cells on Export
posted

First, I am using 7.3 and C#.

I would like to format the font size, font name, and font weight / color etc. for the 1st and last Rows in my excel export.

I have a grid that uses footers and the data exports correctly, but I cannot change the font size.
I also cannot change the font size etc. for the column headers.


The font size for cell's exported from row 2 through the next to last row is modifiable in the Export_InitializeColumn with

e.Column.CellStyle.Font.Size = FontUnit.Point(8);

However, if I try to use

e.Column.Footer.Style.Font.Size = FontUnit.Point(10); 
or
e.Column.Header.Style.Font.Size =
FontUnit.Point(10);

Nothing is affected.

What is the correct syntax to make the font size (and other font property) changes to the "Header" and "Footer" rows?

 Thanks,

Jonathan

Parents
No Data
Reply
  • 4960
    posted

    I think you should be able to modify the IWorksheetCellFormat in the HeaderCellExported and FooterCellExported events for these cells, this will have a direct effect on the formatting as Excel sees it.

    This next blog entry describes some of the rich formatted string capabilities that should be available to you in 2007 vol. 3,
    http://blogs.infragistics.com/blogs/derekh/archive/2007/12/27/coloring-keywords-in-your-excel-worksheet.aspx

    For Font.Size, use the Height property of the FormattedStringFont instance.  Because it is Excel formatting, it is measured in twips, so as a rough rule of thumb, multiply the desired pixel font size by 20.

Children
No Data