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
1015
Right Aligning BoundDataField in Exported PDF
posted

I'm just trying to right align a cell in the exported PDF using the WebHierarchicalDataGrid and WebDocumentExporter - 13.1.20131.2107

Here's my column:

<ig:BoundDataField Key="Hours" DataFormatString="{0:###,##0.0}" Width="4%" DataType="System.Decimal" CssClass="numCol">
<Header Text="Hours" CssClass="right"></Header>
</ig:BoundDataField>

The numCol class just sets the text-align to right.  It works fine in the browser.

.numCol {text-align: right !important;white-space: nowrap; }

I even went so far as to try to set the report's cell alignment in all the events but they don't take.

void docExporter_GridRecordItemExported(object sender, DocumentGridRecordItemExportedEventArgs e)
{
	string css = e.GridCell.Column.CssClass.ToLower();
	if (css.Contains("numcol"))
	{
		e.CellElement.Alignment.Horizontal = Alignment.Right;				
	}
}

Any ideas?  Thanks!

Parents Reply Children