Class FileDataHolder
Class used for holding file data.
Inheritance
Namespace: Syncfusion.XlsIO.Implementation.XmlSerialization
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class FileDataHolder : Object, 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. |
System.IO.Stream | stream | Stream to get initial data from. |
System.String | password | Password to use during for decryption. |
FileDataHolder(WorkbookImpl, String, String)
Initializes a new instance of the FileDataHolder class.
Declaration
public FileDataHolder(WorkbookImpl book, string filename, string password)
Parameters
Type | Name | Description |
---|---|---|
WorkbookImpl | book | Parent workbook for the new instance. |
System.String | filename | File name to get initial data from. |
System.String | password | Password to use during for decryption. |
Fields
BinaryExtension
Binary item extension.
Declaration
public const string BinaryExtension = "bin"
Field Value
Type |
---|
System.String |
CorePropertiesPartName
Default name of the core properties part.
Declaration
public const string CorePropertiesPartName = "docProps/core.xml"
Field Value
Type |
---|
System.String |
CustomPropertiesPartName
Default name of the custom properties part.
Declaration
public const string CustomPropertiesPartName = "docProps/custom.xml"
Field Value
Type |
---|
System.String |
CustomPropertyPathStart
Start of the worksheet custom property item.
Declaration
public const string CustomPropertyPathStart = "xl/customProperty"
Field Value
Type |
---|
System.String |
DefaultPicturePathFormat
Path format for pictures.
Declaration
public const string DefaultPicturePathFormat = "xl/media/image{0}."
Field Value
Type |
---|
System.String |
ExtendedPropertiesPartName
Default name of the extended properties part.
Declaration
public const string ExtendedPropertiesPartName = "docProps/app.xml"
Field Value
Type |
---|
System.String |
ExternLinksPathFormat
Default name format for the external link items.
Declaration
public const string ExternLinksPathFormat = "xl/externalLinks/externalLink{0}.xml"
Field Value
Type |
---|
System.String |
PivotCacheDefinitionPathFormat
Default name format for cache definition.
Declaration
public const string PivotCacheDefinitionPathFormat = "xl/pivotCache/pivotCacheDefinition{0}.xml"
Field Value
Type |
---|
System.String |
PivotCacheRecordsPathFormat
Default name format for cache records.
Declaration
public const string PivotCacheRecordsPathFormat = "xl/pivotCache/pivotCacheRecords{0}.xml"
Field Value
Type |
---|
System.String |
PivotTablePathFormat
Default name format for pivot table.
Declaration
public const string PivotTablePathFormat = "xl/pivotTables/pivotTable{0}.xml"
Field Value
Type |
---|
System.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 |
---|
System.String |
DefaultContentTypes
Gets dictionary with default content types. Read-only.
Declaration
public IDictionary<string, string> DefaultContentTypes { get; }
Property Value
Type |
---|
System.Collections.Generic.IDictionary<System.String, System.String> |
ExtensionStream
Gets or sets extension stream
Declaration
public Stream ExtensionStream { get; set; }
Property Value
Type |
---|
System.IO.Stream |
FileVersion
Gets the File Version
Declaration
public FileVersion FileVersion { get; }
Property Value
Type |
---|
FileVersion |
Item[Relation, String]
Returns archive item corresponding to the relation.
Declaration
public ZipArchiveItem this[Relation relation, string parentPath] { get; }
Parameters
Type | Name | Description |
---|---|---|
Relation | relation | |
System.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 |
---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
LastChartIndex
Gets or sets last used index of the chart item.
Declaration
public int LastChartIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
LastCommentIndex
Gets or sets last used index of the comment item.
Declaration
public int LastCommentIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
LastDrawingIndex
Gets or sets last used index of the drawing item.
Declaration
public int LastDrawingIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
LastImageId
Gets or sets last used image id.
Declaration
public int LastImageId { get; set; }
Property Value
Type |
---|
System.Int32 |
LastImageIndex
Gets or sets last used index of the image item.
Declaration
public int LastImageIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
LastVmlIndex
Gets or sets last used index of the vml item.
Declaration
public int LastVmlIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
OverriddenContentTypes
Gets dictionary with overridden content types. Read-only.
Declaration
public IDictionary<string, string> OverriddenContentTypes { get; }
Property Value
Type |
---|
System.Collections.Generic.IDictionary<System.String, System.String> |
ParsedDxfsCount
Gets number of parsed dfx styles or int min value if nothing was parsed.
Declaration
public int ParsedDxfsCount { get; }
Property Value
Type |
---|
System.Int32 |
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 |
---|
System.Collections.Generic.Dictionary<System.String, System.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 |
---|
System.Collections.Generic.List<System.Int32> |
Methods
AddOverriddenContentType(String, String)
Adds overriden content type.
Declaration
public void AddOverriddenContentType(string fileName, string contentType)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | File name to override content type for. |
System.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. |
System.String | parentItemPath | Path to the parent item. |
System.String | strItemPath | Path to the desired item. |
Returns
Type | Description |
---|---|
System.Xml.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 |
---|---|---|
System.String | strTarget |
Returns
Type |
---|
System.String |
GetImageItemName(Int32)
Gets image item name.
Declaration
public string GetImageItemName(int i)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | i | Image index to get name for. |
Returns
Type | Description |
---|---|
System.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 |
---|---|---|
System.Drawing.Imaging.ImageFormat | format | Image format to convert. |
System.String | strExtension | Resulting file extension. |
Returns
Type | Description |
---|---|
System.String | Content type for this image format. |
GetSheet(String)
Extracts worksheet.
Declaration
public WorksheetBaseImpl GetSheet(string sheetName)
Parameters
Type | Name | Description |
---|---|---|
System.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 |
---|---|---|
System.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 |
---|---|---|
System.String | strContentType | Content type. |
System.String | strItemName | Name of the item that has specified content type. |
Returns
Type | Description |
---|---|
System.Xml.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 |
---|---|---|
System.String | strContentType | Content type. |
ParseContentType()
Parses content type.
Declaration
public void ParseContentType()
ParseDocument(ref List<Color>, Boolean)
Parses document.
Declaration
public void ParseDocument(ref List<Color> themeColors, bool parseOnDemand)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.Drawing.Color> | themeColors | Represents theme colors in document. |
System.Boolean | parseOnDemand |
ParseDocumentProperties()
Parses all document properties.
Declaration
public void ParseDocumentProperties()
ParseDxfsCollection()
Parses Dxf styles collection.
Declaration
public List<DxfImpl> ParseDxfsCollection()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<DxfImpl> | Dxf style collection. |
PrepareNewItem(String, String, String, RelationCollection, String, ref Int32, 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 |
---|---|---|
System.String | itemNameStart | Start of the item's name. |
System.String | extension | Represents file extension. |
System.String | contentType | Content type for the new item. |
RelationCollection | relations | Parent relations collection. |
System.String | relationType | Relation type. |
System.Int32 | itemsCounter | Variable used as counter of already created items of the same type. |
ZipArchiveItem | item | Created archive item. |
Returns
Type | Description |
---|---|
System.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 |
---|---|---|
System.Drawing.Imaging.ImageFormat | imageFormat | Image format of the picture to register content type for. |
Returns
Type | Description |
---|---|
System.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 |
---|---|---|
System.IO.Stream | stream | Stream to save into. |
ExcelSaveType | saveType | Type of the saving format. |
SaveDocument(String, ExcelSaveType)
Saves document into specified file.
Declaration
public void SaveDocument(string filename, ExcelSaveType saveType)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename | Name of the file 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 |
---|---|---|
System.Drawing.Image | image | Image to save. |
System.Drawing.Imaging.ImageFormat | imageFormat | Destination image format. |
System.String | proposedPath | Proposed item name, null - autogenerate. |
Returns
Type | Description |
---|---|
System.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 |
---|---|---|
System.Drawing.Image | image | Image to save. |
System.String | proposedPath | Proposed item name, null - autogenerate. |
Returns
Type | Description |
---|---|
System.String | Generated item name. |
SaveRelations(String, RelationCollection)
Serializes relations collection.
Declaration
public void SaveRelations(string parentPartName, RelationCollection relations)
Parameters
Type | Name | Description |
---|---|---|
System.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 |
---|---|---|
System.IO.Stream | stream | Stream to save into. |
WorkbookImpl | book | Workbook to save. |
ExcelSaveType | saveType | Save type (template or ordinary xls). |
Serialize(String, WorkbookImpl, ExcelSaveType)
Saves workbook into specified file.
Declaration
public void Serialize(string fullName, WorkbookImpl book, ExcelSaveType saveType)
Parameters
Type | Name | Description |
---|---|---|
System.String | fullName | Destination file name. |
WorkbookImpl | book | Workbook to save. |
ExcelSaveType | saveType | Save type. |
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 |
---|---|
System.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 | |
System.String | itemName | |
System.String | tablerels |
SerializeTableRelation(String, String)
Serialize Table Relations
Declaration
public void SerializeTableRelation(string ItemName, string queryTable)
Parameters
Type | Name | Description |
---|---|---|
System.String | ItemName | |
System.String | queryTable |