public interface ExportFormatting
For server-based exports (ListGrid
or DataSource.exportData()):
exportAs
is a spreadsheet format (XLS or
OOXML), dsField.format or
dsField.exportFormat
will be used if specified, otherwise, DataSourceField.dateFormatter
will
be used if specified, otherwise, no formatting will be applied and the date or number will
be shown in the spreadsheet program's default formatting. DSRequest.exportRawValues
to false,
format settings available to server will be used, exactly as explained above for
spreadsheet exports with exportData()
. ListGrid.exportClientData()
): exportAs
is a spreadsheet format
(XLS or OOXML), rules are the same as for server-driven export except that
dateFormatter
settings on client-side UI components will be used if a
built-in formatter is used (for example, if ListGridField.dateFormatter
is
set to the built-in formatter "toEuropeanShortDate")). If you need date values to appear
exactly as shown to the user, set DSRequest.exportDatesAsFormattedString
, but see the docs for this property for the
drawbacks of doing this. exportClientData()
rather
than exportData()
is precisely to create a fully formatted export). If you
instead set ListGrid.exportRawValues
to true, only standard formats appropriate to data interchange
are used, the same as described for exportData()
above. displayField
in the same record, a
com.smartgwt.client.types.ValueMap
or an optionDataSource
. The
table below shows what values get exported for each of these possibilities, in combination with
the exportValueFields
flag and
whether you are using client-driven or server-driven export (note,
exportValueFields
has no effect for server-driven exports):
Use case | Exports value field | Exports display field |
exportClientData(), in-record displayField, exportValueFields=true | ✓ | ✓ |
exportClientData(), in-record displayField, exportValueFields=false | ✓ | |
exportClientData(), valueMap declared in DataSource, exportValueFields=true | ✓ | |
exportClientData(), valueMap declared in DataSource, exportValueFields=false | ✓ | |
exportClientData(), valueMap defined in code, exportValueFields=true | ✓ | |
exportClientData(), valueMap defined in code, exportValueFields=false | ✓ | |
exportClientData(), optionDataSource, exportValueFields=true | ✓ | ✓ |
exportClientData(), optionDataSource, exportValueFields=false | ✓ | |
exportData(), in-record displayField (must be declared in DataSource) | ✓ | ✓ |
exportData(), valueMap declared in DataSource | ✓ | |
exportData(), valueMap defined in code | ✓ | |
exportData(), optionDataSource | ✓ |
DetailViewerField.getFormat()
,
DetailViewerField.getExportFormat()
,
ListGridField.getFormat()
,
ListGridField.getExportFormat()
,
DSRequest.getExportRawValues()
,
DSRequest.getExportPropertyIdentifier()
,
DSRequest.getExportDatesAsFormattedString()
,
DSRequest.getExportTZ()
,
CubeGrid.getValueFormat()
,
CubeGrid.getValueExportFormat()
,
SimpleType.getFormat()
,
SimpleType.getExportFormat()
,
FormItem.getExportFormat()