Class FileDataHolder
Class used for holding file data.
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation.XmlSerialization
Assembly: Syncfusion.XlsIO.NET.dll
Syntax
public class FileDataHolder : IWorkbookSerializator, IDisposable
Constructors
FileDataHolder(WorkbookImpl)
Initializes a new instance of the FileDataHolder class.
Declaration
public FileDataHolder(WorkbookImpl book)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkbookImpl | book | Parent workbook for the new instance. |
FileDataHolder(WorkbookImpl, Stream, string)
Initializes a new instance of the FileDataHolder class.
Declaration
public FileDataHolder(WorkbookImpl book, Stream stream, string password)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkbookImpl | book | Parent workbook for the new instance. |
| Stream | stream | Stream to get initial data from. |
| string | password | Password to use during for decryption. |
Fields
BinaryExtension
Binary item extension.
Declaration
public const string BinaryExtension = "bin"
Field Value
| Type |
|---|
| string |
CorePropertiesPartName
Default name of the core properties part.
Declaration
public const string CorePropertiesPartName = "docProps/core.xml"
Field Value
| Type |
|---|
| string |
CustomPropertiesPartName
Default name of the custom properties part.
Declaration
public const string CustomPropertiesPartName = "docProps/custom.xml"
Field Value
| Type |
|---|
| string |
CustomPropertyPathStart
Start of the worksheet custom property item.
Declaration
public const string CustomPropertyPathStart = "xl/customProperty"
Field Value
| Type |
|---|
| string |
DefaultPicturePathFormat
Path format for pictures.
Declaration
public const string DefaultPicturePathFormat = "xl/media/image{0}."
Field Value
| Type |
|---|
| string |
ExtendedPropertiesPartName
Default name of the extended properties part.
Declaration
public const string ExtendedPropertiesPartName = "docProps/app.xml"
Field Value
| Type |
|---|
| string |
ExternLinksPathFormat
Default name format for the external link items.
Declaration
public const string ExternLinksPathFormat = "xl/externalLinks/externalLink{0}.xml"
Field Value
| Type |
|---|
| string |
PivotCacheDefinitionPathFormat
Default name format for cache definition.
Declaration
public const string PivotCacheDefinitionPathFormat = "xl/pivotCache/pivotCacheDefinition{0}.xml"
Field Value
| Type |
|---|
| string |
PivotCacheRecordsPathFormat
Default name format for cache records.
Declaration
public const string PivotCacheRecordsPathFormat = "xl/pivotCache/pivotCacheRecords{0}.xml"
Field Value
| Type |
|---|
| string |
PivotTablePathFormat
Default name format for pivot table.
Declaration
public const string PivotTablePathFormat = "xl/pivotTables/pivotTable{0}.xml"
Field Value
| Type |
|---|
| string |
Properties
Archive
Gets zip archive object that stores Excel 2007 document.
Declaration
public ZipArchive Archive { get; }
Property Value
| Type |
|---|
| ZipArchive |
CalculationId
Gest or sets Calculation ID
Declaration
public string CalculationId { get; set; }
Property Value
| Type |
|---|
| string |
DefaultContentTypes
Gets dictionary with default content types. Read-only.
Declaration
public IDictionary<string, string> DefaultContentTypes { get; }
Property Value
| Type |
|---|
| IDictionary<string, string> |
ExtensionStream
Gets or sets extension stream
Declaration
public Stream ExtensionStream { get; set; }
Property Value
| Type |
|---|
| Stream |
FileVersion
Gets the File Version
Declaration
public FileVersion FileVersion { get; }
Property Value
| Type |
|---|
| FileVersion |
this[Relation, string]
Returns archive item corresponding to the relation.
Declaration
public ZipArchiveItem this[Relation relation, string parentPath] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| Relation | relation | |
| string | parentPath |
Property Value
| Type |
|---|
| ZipArchiveItem |
ItemsToRemove
Gets Items that must be removed after parsing complete. Read-only.
Declaration
public Dictionary<string, object> ItemsToRemove { get; }
Property Value
| Type |
|---|
| Dictionary<string, object> |
LastChartIndex
Gets or sets last used index of the chart item.
Declaration
public int LastChartIndex { get; set; }
Property Value
| Type |
|---|
| int |
LastCommentIndex
Gets or sets last used index of the comment item.
Declaration
public int LastCommentIndex { get; set; }
Property Value
| Type |
|---|
| int |
LastDrawingIndex
Gets or sets last used index of the drawing item.
Declaration
public int LastDrawingIndex { get; set; }
Property Value
| Type |
|---|
| int |
LastImageId
Gets or sets last used image id.
Declaration
public int LastImageId { get; set; }
Property Value
| Type |
|---|
| int |
LastImageIndex
Gets or sets last used index of the image item.
Declaration
public int LastImageIndex { get; set; }
Property Value
| Type |
|---|
| int |
LastVmlIndex
Gets or sets last used index of the vml item.
Declaration
public int LastVmlIndex { get; set; }
Property Value
| Type |
|---|
| int |
OverriddenContentTypes
Gets dictionary with overridden content types. Read-only.
Declaration
public IDictionary<string, string> OverriddenContentTypes { get; }
Property Value
| Type |
|---|
| IDictionary<string, string> |
ParsedDxfsCount
Gets number of parsed dfx styles or int min value if nothing was parsed.
Declaration
public int ParsedDxfsCount { get; }
Property Value
| Type |
|---|
| int |
Parser
Gets Excel 2007 parser.
Declaration
public Excel2007Parser Parser { get; }
Property Value
| Type |
|---|
| Excel2007Parser |
PreservedCaches
Gets the preserved caches
Declaration
public Dictionary<string, string> PreservedCaches { get; }
Property Value
| Type |
|---|
| Dictionary<string, string> |
Serializator
Gets object used for serialization.
Declaration
public Excel2007Serializator Serializator { get; }
Property Value
| Type |
|---|
| Excel2007Serializator |
Workbook
Gets parent workbook. Read-only.
Declaration
public WorkbookImpl Workbook { get; }
Property Value
| Type |
|---|
| WorkbookImpl |
XFIndexes
Gets cell styles.
Declaration
public List<int> XFIndexes { get; }
Property Value
| Type |
|---|
| List<int> |
Methods
AddOverriddenContentType(string, string)
Adds overriden content type.
Declaration
public void AddOverriddenContentType(string fileName, string contentType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName | File name to override content type for. |
| string | contentType | Content type to set. |
Connections()
Connection
Declaration
public void Connections()
CreateReaderAndFixBr(Relation, string, out string)
Creates XmlReader and fixes potential br tags issue.
Declaration
public XmlReader CreateReaderAndFixBr(Relation relation, string parentItemPath, out string strItemPath)
Parameters
| Type | Name | Description |
|---|---|---|
| Relation | relation | Relation that points to the archive item. |
| string | parentItemPath | Path to the parent item. |
| string | strItemPath | Path to the desired item. |
Returns
| Type | Description |
|---|---|
| XmlReader | Created reader. |
Dispose()
Dispose
Declaration
public void Dispose()
GetContentType(string)
Gets content type by item name.
Declaration
public string GetContentType(string strTarget)
Parameters
| Type | Name | Description |
|---|---|---|
| string | strTarget |
Returns
| Type |
|---|
| string |
GetImageItemName(int)
Gets image item name.
Declaration
public string GetImageItemName(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | i | Image index to get name for. |
Returns
| Type | Description |
|---|---|
| string | Name of Image item. |
GetPictureContentType(ImageFormat, out string)
Converts image format into content type and file extension.
Declaration
public static string GetPictureContentType(ImageFormat format, out string strExtension)
Parameters
| Type | Name | Description |
|---|---|---|
| ImageFormat | format | Image format to convert. |
| string | strExtension | Resulting file extension. |
Returns
| Type | Description |
|---|---|
| string | Content type for this image format. |
GetSheet(string)
Extracts worksheet.
Declaration
public WorksheetBaseImpl GetSheet(string sheetName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | sheetName | Represents sheet name. |
Returns
| Type | Description |
|---|---|
| WorksheetBaseImpl | Sheet extracted. |
GetSheetData(string)
Extracts sheet data.
Declaration
public WorksheetDataHolder GetSheetData(string sheetPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | sheetPath | Represents sheet path. |
Returns
| Type | Description |
|---|---|
| WorksheetDataHolder | Extracted sheet data |
GetXmlReaderByContentType(string, out string)
Returns XmlReader for corresponding content type.
Declaration
public XmlReader GetXmlReaderByContentType(string strContentType, out string strItemName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | strContentType | Content type. |
| string | strItemName | Name of the item that has specified content type. |
Returns
| Type | Description |
|---|---|
| XmlReader | Item name. |
ParseArchiveItemByContentType(string)
Parses archive item by content type. Removes relation for this item and the item itself.
Declaration
public void ParseArchiveItemByContentType(string strContentType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | strContentType | Content type. |
ParseContentType()
Parses content type.
Declaration
public void ParseContentType()
ParseDocument(ref List<Color>, bool)
Parses document.
Declaration
public void ParseDocument(ref List<Color> themeColors, bool parseOnDemand)
Parameters
| Type | Name | Description |
|---|---|---|
| List<Color> | themeColors | Represents theme colors in document. |
| bool | parseOnDemand |
ParseDocumentProperties()
Parses all document properties.
Declaration
public void ParseDocumentProperties()
ParseDxfsCollection()
Parses Dxf styles collection.
Declaration
public List<DxfImpl> ParseDxfsCollection()
Returns
| Type | Description |
|---|---|
| List<DxfImpl> | Dxf style collection. |
PrepareNewItem(string, string, string, RelationCollection, string, ref int, out ZipArchiveItem)
Prepares a new archive item.
Declaration
public string PrepareNewItem(string itemNameStart, string extension, string contentType, RelationCollection relations, string relationType, ref int itemsCounter, out ZipArchiveItem item)
Parameters
| Type | Name | Description |
|---|---|---|
| string | itemNameStart | Start of the item's name. |
| string | extension | Represents file extension. |
| string | contentType | Content type for the new item. |
| RelationCollection | relations | Parent relations collection. |
| string | relationType | Relation type. |
| int | itemsCounter | Variable used as counter of already created items of the same type. |
| ZipArchiveItem | item | Created archive item. |
Returns
| Type | Description |
|---|---|
| string | Represents relation ID |
RegisterContentTypes(ImageFormat)
Registers correct content type into collections of default content types.
Declaration
public string RegisterContentTypes(ImageFormat imageFormat)
Parameters
| Type | Name | Description |
|---|---|---|
| ImageFormat | imageFormat | Image format of the picture to register content type for. |
Returns
| Type | Description |
|---|---|
| string | Proposed picture file extension. |
SaveDocument(ExcelSaveType)
Saves document inside internal zip archive.
Declaration
public void SaveDocument(ExcelSaveType saveType)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelSaveType | saveType | Type of the saving format. |
SaveDocument(Stream, ExcelSaveType)
Saves document into specified stream.
Declaration
public void SaveDocument(Stream stream, ExcelSaveType saveType)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | Stream to save into. |
| ExcelSaveType | saveType | Type of the saving format. |
SaveImage(Image, ImageFormat, string)
Saves image into appropriate location inside document.
Declaration
public string SaveImage(Image image, ImageFormat imageFormat, string proposedPath)
Parameters
| Type | Name | Description |
|---|---|---|
| Image | image | Image to save. |
| ImageFormat | imageFormat | Destination image format. |
| string | proposedPath | Proposed item name, null - autogenerate. |
Returns
| Type | Description |
|---|---|
| string | Generated item name. |
SaveImage(Image, string)
Saves image into appropriate location inside document.
Declaration
public string SaveImage(Image image, string proposedPath)
Parameters
| Type | Name | Description |
|---|---|---|
| Image | image | Image to save. |
| string | proposedPath | Proposed item name, null - autogenerate. |
Returns
| Type | Description |
|---|---|
| string | Generated item name. |
SaveRelations(string, RelationCollection)
Serializes relations collection.
Declaration
public void SaveRelations(string parentPartName, RelationCollection relations)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parentPartName | Name of the parent |
| RelationCollection | relations | Represents relations |
Serialize(Stream, WorkbookImpl, ExcelSaveType)
Saves workbook into stream.
Declaration
public void Serialize(Stream stream, WorkbookImpl book, ExcelSaveType saveType)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | Stream to save into. |
| WorkbookImpl | book | Workbook to save. |
| ExcelSaveType | saveType | Save type (template or ordinary xls). |
SerializeExternalLink(ExternWorkbookImpl)
Serializes single external link.
Declaration
public string SerializeExternalLink(ExternWorkbookImpl externBook)
Parameters
| Type | Name | Description |
|---|---|---|
| ExternWorkbookImpl | externBook | Extern workbook item that contains link information to serialize. |
Returns
| Type | Description |
|---|---|
| string | Name of the external link item. |
SerializeQueryTable(IListObject, string, string)
Serialize Query Table
Declaration
public void SerializeQueryTable(IListObject listobject, string itemName, string tablerels)
Parameters
| Type | Name | Description |
|---|---|---|
| IListObject | listobject | |
| string | itemName | |
| string | tablerels |
SerializeTableRelation(string, string)
Serialize Table Relations
Declaration
public void SerializeTableRelation(string ItemName, string queryTable)
Parameters
| Type | Name | Description |
|---|---|---|
| string | ItemName | |
| string | queryTable |