Click or drag to resize
DataExportHelper Class
Provides DataSet export functionality to formats defined by DataExportFormatEnum.
Inheritance Hierarchy

Namespace: CMS.ImportExport
Assembly: CMS.ImportExport (in CMS.ImportExport.dll) Version: 9.0.0
Syntax
C#
public class DataExportHelper : CoreMethods

The DataExportHelper type exposes the following members.

Constructors
  NameDescription
Protected methodDataExportHelper
Default constructor.
Public methodDataExportHelper(DataSet)
Constructor initializing data source.
Top
Fields
  NameDescription
Protected fieldStatic memberDEFAULT_COLUMN_NAME
Name of element representing column used when there is no other name available.
Protected fieldStatic memberDEFAULT_TEMPLATE_NAME
Default name of Excel export template.
Protected fieldStatic memberMAX_EXCEL_CELL_SIZE
Maximum size of Excel cell.
Protected fieldmDataExportTemplatePath
Holds path leading to Excel export template.
Protected fieldmDataSource
Source of data.
Protected fieldmExportedColumns
Holds actually exported columns.
Protected fieldmFileName
File of name to export (without extension).
Protected fieldmFileNameWithExtension
File of name to export with extension.
Protected fieldmMacroResolver
Holds macro resolver.
Protected fieldmUseSharedStringStorage
Indicates whether to use shared string table during Excel export.
Top
Properties
  NameDescription
Public propertyAllowExportEmptyDataSource
Determines whether to allow export empty data source or raise an error
Public propertyCSVDelimiter
Defines delimiter for CSV format.
Public propertyDataExportTemplateFolder
Gets a startup path for template lookup.
Public propertyDataExportTemplatePath
Gets a relative path leading to template.
Public propertyDataSource
Gets or sets the source of data to export.
Public propertyFileName
Name of exported file (without extension).
Public propertyFileNameWithExtension
Name of exported file with extension.
Public propertyGenerateHeader
Indicates whether to generate also a header row.
Public propertyMacroResolver
Gets or sets macro resolver.
Public propertyTopN
Top N rows to export.
Public propertyUseSharedStringStorage
Defines whether to use shared string table for storing text values. When value is false text is being stored as inline string. Applies only to Excel export.
Public propertyUseTemplate
Indicates whether to use XLSX template.
Top
Methods
  NameDescription
Public methodStatic memberCreateColumnName
Creates column name from column number ("1" -> "A")
Public methodStatic memberCreateColumnReference
Creates column reference from column and row numbers.
Public methodExportData(DataExportFormatEnum, Stream)
Exports data stored in DataSource property, writes it to given stream.
Public methodExportData(DataExportFormatEnum, HttpResponse)
Exports data stored in DataSource property, writes it to given response.
Public methodExportToCSV(DataSet, Int32, Stream)
Exports specified table of given DataSet to CSV format.
Public methodExportToCSV(DataSet, Int32, Stream, Boolean)
Exports specified table of given DataSet to CSV format.
Protected methodGetColumnCaptionText
Gets a caption for given column name.
Protected methodGetColumnIndex
Gets index of a column corresponding to columns actually selected to export.
Public methodStatic memberGetColumnName
Returns name of column from given cell reference (ex. "B4" -> "B")
Public methodStatic memberGetColumnNumber
Gets number of given column name ("A" -> "1")
Public methodStatic memberGetDataExportFormatContentType
Returns content type for given format.
Public methodStatic memberGetDataExportFormatEnum
Returns DataExportFormat enum.
Public methodStatic memberGetDataExportFormatString
Returns DataExportFormat string.
Protected methodGetExportedColumns
Gets columns that should be exported.
Protected methodGetExportedData
Gets the DataSet with the formatted exported data
Protected methodGetExportedValue
Gets the exported value for the given
Public methodStatic memberGetRowNumber
Returns number of a row from given cell reference (ex. "B4" -> "4")
Protected methodGetXMLElementName
Normalizes header text to be usable as element name.
Protected methodRaiseError
Raises error event.
Top
Events
  NameDescription
Public eventError
Error handler.
Protected eventExternalDataBound
External data bound handler.
Top
See Also