- 2 min to read
This document describes how to format data in a report by applying a .NET format to it.
When using this mode, you can only apply formatting to values bound to a control's properties, and not to the controls' static content.
See Data Binding Modes to learn more about the available binding modes.
Format Data-Bound Controls
Select a data-bound report control to which to apply a format string and click its smart tag. Click the XRBinding.FormatString property's ellipsis button, and in the invoked FormatString Editor, choose the required formatting by selecting one of the built-in patterns or entering a custom format string.
When using mail-merge to make a label display both static and dynamic data, you can add a format to the label's dynamic contents by separating it from the data field name with the ! symbol.
The XRBinding.FormatString setting is ignored for Null, DBNull and String.Empty values.
Select a label with an assigned summary function, click its smart tag and specify the Format String property.
Apply the Native XLSX Format
In addition to a .NET format string, you can also apply a native XLSX format to an XRLabel's or XRTableCell's content using its XRControl.XlsxFormatString property. A value assigned to this property is converted to a native Excel format string when exporting the report to XLSX if the XlExportOptionsBase.TextExportMode property is set to Value.
When the XRControl.XlsxFormatString property is not set to any value, the specified .NET format string is applied to the control's content.
When the XlExportOptionsBase.TextExportMode property is set to Text, all control content is exported as plain text with no formatting applied.
The XLSX format has priority over the .NET format. When both formats are specified for a control, the XLSX format is used when a document is exported to XLSX format.
See Export to XLSX for more information.