We have most of our PDF exporting working, but for 2 issues. Hoping someone can point us in the right direction...
2. Add a double line under the column headings (only show a bottom border)
We're overriding the UltraGridDocumentExporter class and for the bold issue, We’ve tried setting the property on the grid in initialize layout as well in the beginExport, headerCellExporting, rowExporting, and headerColExporting events. Nothing worked.
Thanks.
Are you setting the properties on the grid, or on the Document elements that are being created? You'll want to manipulate the Document elements directly.
For example, in the HeaderRowExporting event you'll want to use the eventargs.ColumnHeaderContainer which will give you access to an IGridCell.
You'll want to set the Border property on the IGridCell to match what you're looking for.
Hope this helps,
-Tony
Thanks for your help, but problem with this answer is that we're on 8.2 not 8.3 and I don't see those properties in that version.
Can't upgrade right now as we are in final beta testing and ready to release. Too close to release to be screwing around with control versions...
Those properties exist in the older versions dating back to the initial release of the Document Exporter.
Actually, if you are using the WinGrid (which you seem to be since you are posting in the WinGrid forum), making the headers bold is very easy. You just handle the BeginExport event of the UltraGridDocumentExporter. This event passes you a layout on the event args. This is a clone of the DisplayLayout of the grid. Since it's a clone, you can modify it any way you like and it will affect the export, but not the on-screen grid. So you could simply set e.Layout.HeaderAppearance.FontData.Bold to true.
Thanks Mike but that was actually the first thing that I tried. I have found that most of the grid settings translate well on the PDF export. No matter what I have tried, I cannot get the heading cells (or any other grid cells I specify) to be bold. I've tried setting it to bold on BeginExport as well as the CellExporting, RowExporting, HeaderRowExporting, HeaderCellExporting and HeaderColExporting events and the cells remain unbolded.
This might be an issue with the particular font you are using. If the font doesn't explicitly support Bold type, then I think the PDF engine will simply make the font a little bigger to simulate bold. But it can't actually bold fonts that don't have support for it.