Subsections of Sheetize Namespace
Class AbstractLoadOptionsProvider
Info
Implementation to provide multiple load options for processes that use multiple inputs(such as template files).
Implementation to provide multiple load options for processes
that use multiple inputs(such as template files).
public abstract class AbstractLoadOptionsProvider
Inheritance
object ←
AbstractLoadOptionsProvider
Inherited Members
For example, Sheetize.SpreadsheetMerger feature requires
multiple template files to merge.
Constructors
AbstractLoadOptionsProvider()
protected AbstractLoadOptionsProvider()
Properties
Current
Gets the load options from which to load data of currently processed part.
public abstract LoadOptions Current { get; }
Property Value
LoadOptions
Methods
Finish(LoadOptions)
Releases resources after processing currently part of input.
public virtual void Finish(LoadOptions part)
Parameters
part
LoadOptions: the load options used for currently split part.
By default this method just closes the stream specified by the
Sheetize.LoadOptions.InputStream directly(if the load options
specified a Stream as source).
User may overwrite this method to control how to release resources
according to their requirement and the implementation of
Sheetize.AbstractLoadOptionsProvider.Current.
MoveNext()
Checks whether there is more input.
public abstract bool MoveNext()
Returns
bool :
Class AbstractSaveOptionsProvider
Info
Implementation to provide multiple save options for processes that require multiple outputs. For example, Sheetize.SpreadsheetSplitter feature requires multiple destinations to save the split files.
Implementation to provide multiple save options for processes
that require multiple outputs. For example,
Sheetize.SpreadsheetSplitter feature requires multiple destinations
to save the split files.
public abstract class AbstractSaveOptionsProvider
Inheritance
object ←
AbstractSaveOptionsProvider
Derived
Inherited Members
Constructors
AbstractSaveOptionsProvider()
protected AbstractSaveOptionsProvider()
Methods
Finish(SaveOptions)
Releases resources after processing currently split part.
public virtual void Finish(SaveOptions part)
Parameters
part
SaveOptions: the save options used for currently split part.
By default this method just closes the stream specified by the
Sheetize.SaveOptions.OutputStream directly(if the save options
specified a Stream as destination).
User may overwrite this method to control how to release resources
according to their requirement and the implementation of
Sheetize.AbstractSaveOptionsProvider.GetSaveOptions(Sheetize.SplitPartInfo).
GetSaveOptions(SplitPartInfo)
Gets the save options from which to get the output settings for currently split part.
public abstract SaveOptions GetSaveOptions(SplitPartInfo part)
Parameters
Returns
SaveOptions :
Class EbookConverter
Info
Converter for conversion between ebook and other spreadsheet file formats.
public class EbookConverter
Inheritance
object ←
EbookConverter
Inherited Members
Examples
[C#]
LoadOptions loadOptions = new LoadOptions();
loadOptions.InputFile = "MyStory.xlsx";
EbookSaveOptions saveOptions = new EbookSaveOptions();
saveOptions.OutputFile = "res.epub";
EbookConverter.Process(loadOptions, saveOptions);
Methods
Process(LoadOptions, SaveOptions)
Converts between ebook and other spreadsheet file formats.
public static void Process(LoadOptions loadOptions, SaveOptions saveOptions)
Parameters
Class EbookSaveOptions
Info
Options for saving .EPUB, .AZW3.
public class EbookSaveOptions : SaveOptions
Inheritance
object ←
SaveOptions ←
EbookSaveOptions
Inherited Members
- SaveOptions.OutputFile,
- SaveOptions.OutputStream,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
EbookSaveOptions()
public EbookSaveOptions()
Properties
Gets and sets the format of spreadsheet.
public FileFormatType SaveFormat { get; set; }
Property Value
FileFormatType
Class HtmlConverter
Info
Converter for conversion between html files(html, mht, …) and other spreadsheet file formats.
public class HtmlConverter
Inheritance
object ←
HtmlConverter
Inherited Members
Examples
[C#]
LoadOptions loadOptions = new LoadOptions();
loadOptions.InputFile = "Template.xlsx";
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.OutputFile = "res.html";
HtmlConverter.Process(loadOptions, saveOptions);
Methods
Process(LoadOptions, SaveOptions)
Converts file between html and other spreadsheet file formats.
public static void Process(LoadOptions loadOptions, SaveOptions saveOptions)
Parameters
Class HtmlSaveOptions
public class HtmlSaveOptions : SaveOptions
Inheritance
object ←
SaveOptions ←
HtmlSaveOptions
Inherited Members
- SaveOptions.OutputFile,
- SaveOptions.OutputStream,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
HtmlSaveOptions()
Properties
Gets and sets the format of spreadsheet.
public FileFormatType SaveFormat { get; set; }
Property Value
FileFormatType
Class ImageConverter
Info
Converter for converting template file to pdf.
public class ImageConverter
Inheritance
object ←
ImageConverter
Inherited Members
Examples
[C#]
LoadOptions loadOptions = new LoadOptions();
loadOptions.InputFile = "Template.xlsx";
ImageSaveOptions saveOptions = new ImageSaveOptions();
ImageConverter.Process(loadOptions, saveOptions);
Methods
Process(LoadOptions, ImageSaveOptions)
Converts template file to images
public static void Process(LoadOptions loadOptions, ImageSaveOptions saveOptions)
Parameters
When converting to image of format that supports multiple pages(such as tiff),
the specified Sheetize.SaveOptions.OutputFile
or Sheetize.SaveOptions.OutputStream will be used directly for the resultant image.
For other types of image, if the save options has specified Stream as output,
then all resultant images will be saved to the same Stream.
Otherwise, the output files will be build from the specified output file
of the save options by appending sequence number of the sheet and split part.
For example, if the specified output file is Image.png, then the generated image
files will be Image_0_0.png, Image_0_1.png, …, Image_1_0.png, …
Process(LoadOptions, ImageSaveOptions, AbstractSaveOptionsProvider)
Converts template file to images
public static void Process(LoadOptions loadOptions, ImageSaveOptions saveOptions, AbstractSaveOptionsProvider provider)
Parameters
loadOptions
LoadOptions: Options for input and loading:saveOptions
ImageSaveOptions: Options for saving. Its output(Sheetize.SaveOptions.OutputFile or Sheetize.SaveOptions.OutputStream): takes no effect because all outputs will be specified by the “provider” parameter:provider
AbstractSaveOptionsProvider: Provider of save options for saving the generated images
Class ImageSaveOptions
Info
Options for saving image.
public class ImageSaveOptions : SaveOptions
Inheritance
object ←
SaveOptions ←
ImageSaveOptions
Inherited Members
- SaveOptions.OutputFile,
- SaveOptions.OutputStream,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
ImageSaveOptions()
public ImageSaveOptions()
Properties
HorizontalResolution
Gets or sets the horizontal resolution for generated images, in dots per inch.
public int HorizontalResolution { get; set; }
Property Value
int
The default value is 96.
Setting Sheetize.ImageSaveOptions.HorizontalResolution and Sheetize.ImageSaveOptions.VerticalResolution
effects the width and height of the output image in pixels.
ImageType
Gets or sets the format of the generated images.
Default value is Sheetize.ImageType.Png.
public ImageType ImageType { get; set; }
Property Value
ImageType
OnePagePerSheet
If OnePagePerSheet is true, all content of one sheet will output to only one page in result.
The paper size defined by PageSetup will be ignored, but other settings of PageSetup still takes effect.
public bool OnePagePerSheet { get; set; }
Property Value
bool
VerticalResolution
Gets or sets the vertical resolution for generated images, in dots per inch.
public int VerticalResolution { get; set; }
Property Value
int
The default value is 96.
Setting Sheetize.ImageSaveOptions.HorizontalResolution and Sheetize.ImageSaveOptions.VerticalResolution
effects the width and height of the output image in pixels.
Class JsonConverter
Info
Converter for conversion between json data and other spreadsheet file formats.
public class JsonConverter
Inheritance
object ←
JsonConverter
Inherited Members
Examples
[C#]
LoadOptions loadOptions = new LoadOptions();
loadOptions.InputFile = "data.json";
SaveOptions saveOptions = new SaveOptions();
saveOptions.OutputFile = "res.xlsx";
JsonConverter.Process(loadOptions, saveOptions);
Methods
Process(LoadOptions, SaveOptions)
Converts between json data and other spreadsheet file formats.
public static void Process(LoadOptions loadOptions, SaveOptions saveOptions)
Parameters
Class JsonSaveOptions
public class JsonSaveOptions : SaveOptions
Inheritance
object ←
SaveOptions ←
JsonSaveOptions
Inherited Members
- SaveOptions.OutputFile,
- SaveOptions.OutputStream,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
JsonSaveOptions()
Class License
Inheritance
object ←
License
Inherited Members
Examples
[C#]
Sheetize.License license = new Sheetize.License();
license.SetLicense("mylic.lic");
Constructors
License()
Methods
SetLicense(Stream)
Licenses the product by the Stream which provides license data.
public void SetLicense(Stream stream)
Parameters
SetLicense(string)
Licenses the product by the license file.
public void SetLicense(string licenseName)
Parameters
Class LoadOptions
Info
Options for loading template file.
Inheritance
object ←
LoadOptions
Derived
Inherited Members
Constructors
LoadOptions()
Properties
Gets and sets the file(with path if needed) of the template.
public string InputFile { get; set; }
Property Value
string
When setting a non-null and non-empty path to this property,
the previously set value for Sheetize.LoadOptions.InputStream will be ignored.
Gets and sets the Stream of the template.
public Stream InputStream { get; set; }
Property Value
Stream
When setting a non-null Stream to this property,
the previously set value for Sheetize.LoadOptions.InputFile will be ignored.
Class LockerSaveOptions
Info
Options to lock excel files.
public class LockerSaveOptions : SaveOptions
Inheritance
object ←
SaveOptions ←
LockerSaveOptions
Inherited Members
- SaveOptions.OutputFile,
- SaveOptions.OutputStream,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
LockerSaveOptions()
public LockerSaveOptions()
Properties
Password
Password to open the file.
public string Password { get; set; }
Property Value
string
PasswordOfWriteProtection
Password to modify the file.
public string PasswordOfWriteProtection { get; set; }
Property Value
string
SettingsOfWorkbookProtection
Protection settings to protect the workbook.
public ProtectionSettings SettingsOfWorkbookProtection { get; set; }
Property Value
ProtectionSettings
SettingsOfWorksheetProtection
The default protection settings used to protect the worksheet.
public ProtectionSettings SettingsOfWorksheetProtection { get; set; }
Property Value
ProtectionSettings
Methods
GetPasswordOfWorksheetProtection(SplitPartInfo)
Gets the protection settings to protect one worksheet.
public virtual ProtectionSettings GetPasswordOfWorksheetProtection(SplitPartInfo info)
Parameters
info
SplitPartInfo: Infomation about current sheet which needs to be protected.
Returns
ProtectionSettings : the protection settings to protect current sheet.
By default this method returns the settings specified by Sheetize.LockerSaveOptions.SettingsOfWorksheetProtection.
If it is null, current sheet will not be protected.
Class PdfConverter
Info
Converter for converting template file to pdf.
public class PdfConverter
Inheritance
object ←
PdfConverter
Inherited Members
Examples
[C#]
LoadOptions loadOptions = new LoadOptions();
loadOptions.InputFile = "Template.xlsx";
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.OutputFile = "res.pdf";
PdfConverter.Process(loadOptions, saveOptions);
Methods
Process(LoadOptions, PdfSaveOptions)
Converts template file to pdf
public static void Process(LoadOptions loadOptions, PdfSaveOptions saveOptions)
Parameters
Class PdfSaveOptions
public class PdfSaveOptions : SaveOptions
Inheritance
object ←
SaveOptions ←
PdfSaveOptions
Inherited Members
- SaveOptions.OutputFile,
- SaveOptions.OutputStream,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
PdfSaveOptions()
Class ProtectionSettings
Info
Represents the required settings for protecting one excel file or one sheet in it.
public class ProtectionSettings
Inheritance
object ←
ProtectionSettings
Inherited Members
Constructors
ProtectionSettings()
public ProtectionSettings()
Properties
Password
The password of protection.
public string Password { get; set; }
Property Value
string
ProtectionType
The protection type to lock one excel file or one sheet in it.
public ProtectionType ProtectionType { get; set; }
Property Value
ProtectionType
Class SaveOptions
Inheritance
object ←
SaveOptions
Derived
Inherited Members
Constructors
SaveOptions()
Properties
OutputFile
Gets and sets the file(with path if needed) for saving the generated data.
When setting this property with value other than null or empty string, Sheetize.SaveOptions.OutputStream will be ignored.
public string OutputFile { get; set; }
Property Value
string
OutputStream
Gets and sets the Stream for writing the generated data to.
When setting this property with value other than null, Sheetize.SaveOptions.OutputFile will be ignored.
public Stream OutputStream { get; set; }
Property Value
Stream
Class SaveOptionsProviderAssembling
Info
Implementation to provide save options which save split parts to files and the path of resultant file are named as(it may contains directories): Sheetize.SaveOptionsProviderAssembling.PathHeader+Sheetize.SaveOptionsProviderAssembling.SheetPrefix+SheetIndex(or SheetName) +Sheetize.SaveOptionsProviderAssembling.SplitPartPrefix+SplitPartIndex+Sheetize.SaveOptionsProviderAssembling.PathTail.
Implementation to provide save options which save split parts to files
and the path of resultant file are named as(it may contains directories):
Sheetize.SaveOptionsProviderAssembling.PathHeader+Sheetize.SaveOptionsProviderAssembling.SheetPrefix+SheetIndex(or SheetName)
+Sheetize.SaveOptionsProviderAssembling.SplitPartPrefix+SplitPartIndex+Sheetize.SaveOptionsProviderAssembling.PathTail.
public class SaveOptionsProviderAssembling : AbstractSaveOptionsProvider
Inheritance
object ←
AbstractSaveOptionsProvider ←
SaveOptionsProviderAssembling
Inherited Members
- AbstractSaveOptionsProvider.GetSaveOptions(SplitPartInfo),
- AbstractSaveOptionsProvider.Finish(SaveOptions),
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
SaveOptionsProviderAssembling()
public SaveOptionsProviderAssembling()
Properties
BuildPathWithSheetAlways
Whether add sheet index or name to file path always.
Default value is false, that is, when there is only one sheet,
the sheet index(or name) and corresponding prefix will not be added to the file path.
public bool BuildPathWithSheetAlways { get; set; }
Property Value
bool
BuildPathWithSplitPartAlways
Whether add split part index to file path always.
Default value is false, that is, when there is only one split part,
the split part index and corresponding prefix will not be added to the file path.
public bool BuildPathWithSplitPartAlways { get; set; }
Property Value
bool
Header part(before added content of sheet and split part) of file path.
public string PathHeader { get; set; }
Property Value
string
PathTail
Tailing part(after sequence numbers) of file path.
It should include extension of file name.
public string PathTail { get; set; }
Property Value
string
SaveOptionsTemplate
The template for creating instance of save options in Sheetize.SaveOptionsProviderAssembling.GetSaveOptions(Sheetize.SplitPartInfo).
public SaveOptions SaveOptionsTemplate { get; set; }
Property Value
SaveOptions
If the template has been specified, then the created instance will copy
all setting from it and update the output file accordingly.
SheetIndexOffset
Offset of sheet’s index between what used in file path
and its actual value(Sheetize.SplitPartInfo.SheetIndex).
public int SheetIndexOffset { get; set; }
Property Value
int
Only takes effect when Sheetize.SaveOptionsProviderAssembling.UseSheetName is false.
SheetPrefix
Prefix for the index of worksheet.
public string SheetPrefix { get; set; }
Property Value
string
If there is only one worksheet and Sheetize.SaveOptionsProviderAssembling.BuildPathWithSheetAlways is false,
then this prefix and the sheet index(or name) will not be added to the resultant file path.
SplitPartIndexOffset
Offset of split part’s index between what used in file path
and its actual value(Sheetize.SplitPartInfo.PartIndex).
public int SplitPartIndexOffset { get; set; }
Property Value
int
SplitPartPrefix
Prefix for the index of split part.
public string SplitPartPrefix { get; set; }
Property Value
string
If there is only one split part and Sheetize.SaveOptionsProviderAssembling.BuildPathWithSplitPartAlways is false,
then this prefix and the split part index(0) will not be added to the resultant file path.
UseSheetName
Whether builds the file path with sheet name instead of sheet index. Default value is false.
public bool UseSheetName { get; set; }
Property Value
bool
The sheet name will never be rebuilt automatically.
So when set it to true, please make sure there is no special sheet name
that can cause invalid file path or name.
Methods
GetSaveOptions(SplitPartInfo)
Gets the save options from which to get the output settings for currently split part.
public override SaveOptions GetSaveOptions(SplitPartInfo part)
Parameters
Returns
SaveOptions :
Class SaveOptionsProviderPlaceHolders
Info
Implementation to provide save options which save split parts to files and the path of resultant file are defined with placeholders.
Implementation to provide save options which save split parts to files
and the path of resultant file are defined with placeholders.
public class SaveOptionsProviderPlaceHolders : AbstractSaveOptionsProvider
Inheritance
object ←
AbstractSaveOptionsProvider ←
SaveOptionsProviderPlaceHolders
Inherited Members
- AbstractSaveOptionsProvider.GetSaveOptions(SplitPartInfo),
- AbstractSaveOptionsProvider.Finish(SaveOptions),
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
Instantiates an instance to provide save options according to specified templates.
public SaveOptionsProviderPlaceHolders(string pathTemplate)
Parameters
pathTemplate
string: The template of the resultant file path.
The supported placeholders in file path template:
- ${SheetIndex}: will be replaced by the sheet index of the split part
- ${SheetName}: will be replaced by the sheet name of the split part
- ${SplitPartIndex}: will be replaced by the index of the split part
- ${SheetIndexPrefix}: will be replaced by Sheetize.SaveOptionsProviderPlaceHolders.SheetIndexPrefix
- ${SheetNamePrefix}: will be replaced by Sheetize.SaveOptionsProviderPlaceHolders.SheetNamePrefix
- ${SplitPartPrefix}: will be replaced by Sheetize.SaveOptionsProviderPlaceHolders.SplitPartPrefix
Properties
BuildPathWithSheetAlways
Whether add sheet index or name to file path always.
Default value is false, that is, when there is only one sheet,
the sheet index and name and corresponding prefix(Sheetize.SaveOptionsProviderPlaceHolders.SheetNamePrefix)
will not be added to the file path.
public bool BuildPathWithSheetAlways { get; set; }
Property Value
bool
BuildPathWithSplitPartAlways
Whether add split part index to file path always.
Default value is false, that is, when there is only one split part,
the split part index and corresponding prefix(Sheetize.SaveOptionsProviderPlaceHolders.SplitPartPrefix)
will not be added to the file path.
public bool BuildPathWithSplitPartAlways { get; set; }
Property Value
bool
SaveOptionsTemplate
The template for creating instance of save options in Sheetize.SaveOptionsProviderPlaceHolders.GetSaveOptions(Sheetize.SplitPartInfo).
public SaveOptions SaveOptionsTemplate { get; set; }
Property Value
SaveOptions
If the template has been specified, then the created instance will copy
all setting from it and update the output file accordingly.
SheetIndexOffset
Offset of sheet’s index between what used in file path
and its actual value(Sheetize.SplitPartInfo.SheetIndex).
public int SheetIndexOffset { get; set; }
Property Value
int
SheetIndexPrefix
Prefix for the index of worksheet.
public string SheetIndexPrefix { get; set; }
Property Value
string
If there is only one worksheet and Sheetize.SaveOptionsProviderPlaceHolders.BuildPathWithSheetAlways is false,
then this prefix and the sheet index(or name) will not be added to the resultant file path.
SheetNamePrefix
Prefix for the index of worksheet.
public string SheetNamePrefix { get; set; }
Property Value
string
If there is only one worksheet and Sheetize.SaveOptionsProviderPlaceHolders.BuildPathWithSheetAlways is false,
then this prefix and the sheet index(or name) will not be added to the resultant file path.
SplitPartIndexOffset
Offset of split part’s index between what used in file path
and its actual value(Sheetize.SplitPartInfo.PartIndex).
public int SplitPartIndexOffset { get; set; }
Property Value
int
SplitPartPrefix
Prefix for the index of split part.
public string SplitPartPrefix { get; set; }
Property Value
string
If there is only one split part and Sheetize.SaveOptionsProviderPlaceHolders.BuildPathWithSplitPartAlways is false,
then this prefix and the split part index(0) will not be added to the resultant file path.
Methods
GetSaveOptions(SplitPartInfo)
Gets the save options from which to get the output settings for currently split part.
public override SaveOptions GetSaveOptions(SplitPartInfo part)
Parameters
Returns
SaveOptions :
Class SheetizeException
Info
The exception that is thrown when Sheetize specified error occurs.
public class SheetizeException : ApplicationException, ISerializable
Inheritance
object ←
Exception ←
ApplicationException ←
SheetizeException
Implements
Inherited Members
- Exception.GetBaseException(),
- Exception.ToString(),
- Exception.GetType(),
- Exception.TargetSite,
- Exception.Message,
- Exception.Data,
- Exception.InnerException,
- Exception.HelpLink,
- Exception.Source,
- Exception.HResult,
- Exception.StackTrace,
- Exception.SerializeObjectState,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Properties
Code
Represents custom exception code.
public ExceptionType Code { get; }
Property Value
ExceptionType
Class SignatureData
Info
Data used to add signature for spreadsheet file.
public class SignatureData
Inheritance
object ←
SignatureData
Inherited Members
Constructors
SignatureData()
Properties
CertificateData
Certificate data.
public byte[] CertificateData { get; set; }
Property Value
byte[]
Comment for the signature.
public string Comment { get; set; }
Property Value
string
Password
Password of the certificate file.
public string Password { get; set; }
Property Value
string
Class SignatureSaveOptions
Info
Options for adding signature and saving the signed spreadsheet file.
public class SignatureSaveOptions : SaveOptions
Inheritance
object ←
SaveOptions ←
SignatureSaveOptions
Inherited Members
- SaveOptions.OutputFile,
- SaveOptions.OutputStream,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
SignatureSaveOptions()
public SignatureSaveOptions()
Properties
SignatureData
Signature data used for adding signature for spreadsheet file.
Null value for this property denotes to remove signature from spreadsheet file.
public SignatureData[] SignatureData { get; set; }
Property Value
SignatureData[]
Class SplitPartInfo
Info
Represents the information of one input/output for multiple inputs/outputs, such as current page to be rendered when converting spreadsheet to image.
Represents the information of one input/output for multiple inputs/outputs,
such as current page to be rendered when converting spreadsheet to image.
public class SplitPartInfo
Inheritance
object ←
SplitPartInfo
Inherited Members
For some processes, such as converting workbook to image of format
that supports multiple pages(such as tiff), the Sheetize.SplitPartInfo.SheetIndex
and Sheetize.SplitPartInfo.PartIndex will be -1,
Sheetize.SplitPartInfo.SheetName will be empty.
Properties
PartIndex
Index of current part in sequence(0 based).
-1 means there are no multiple parts so the result is single.
public int PartIndex { get; }
Property Value
int
If multiple sheets need to be processed and every sheet is processed(split)
separately, the part index always starts from 0 for every sheet.
For example, when converting workbook to images,
it represents the output page index of currently processed sheet.
And -1 denotes there is only one page for current sheet.
SheetIndex
Index of the sheet where current part is in. -1 denotes there is only one sheet.
public int SheetIndex { get; }
Property Value
int
SheetName
Name of the sheet where current part is in.
public string SheetName { get; }
Property Value
string
May be null for some situations such as when rendering the whole workbook to tiff image.
Class SplitterSaveOptions
Info
Options for splitting template file.
public class SplitterSaveOptions : SaveOptions
Inheritance
object ←
SaveOptions ←
SplitterSaveOptions
Inherited Members
- SaveOptions.OutputFile,
- SaveOptions.OutputStream,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
SplitterSaveOptions()
public SplitterSaveOptions()
Class SpreadsheetConverter
Info
Converter for conversion between different spreadsheet file formats, such as xls, xlsx, xlsb, spreadsheet ml…
public class SpreadsheetConverter
Inheritance
object ←
SpreadsheetConverter
Inherited Members
Examples
[C#]
LoadOptions loadOptions = new LoadOptions();
loadOptions.InputFile = "Template.xlsx";
SpreadsheetSaveOptions saveOptions = new SpreadsheetSaveOptions();
saveOptions.OutputFile = "res.xlsb";
SpreadsheetConverter.Process(loadOptions, saveOptions);
Methods
Process(LoadOptions, SaveOptions)
Converts between different spreadsheet file formats.
public static void Process(LoadOptions loadOptions, SaveOptions saveOptions)
Parameters
Class SpreadsheetLocker
public class SpreadsheetLocker
Inheritance
object ←
SpreadsheetLocker
Inherited Members
Examples
[C#]
private class MyLockerSaveOptions : LockerSaveOptions
{
public override ProtectionSettings GetPasswordOfWorksheetProtection(SplitPartInfo info)
{
if (info.SheetName == "ToProtect")
{
ProtectionSettings ps = new ProtectionSettings();
ps.Password = "123456";
ps.ProtectionType = ProtectionType.All;
return ps;
}
return null;
}
}
SpreadsheetLocker processor = new SpreadsheetLocker();
LoadOptions loadOptions = new LoadOptions();
loadOptions.InputFile = "Template.xlsx";
MyLockerSaveOptions saveOptions = new MyLockerSaveOptions();
saveOptions.Password = "password to lock file";
saveOptions.OutputFile = "res_locked.xlsx";
SpreadsheetLocker.Process(loadOptions, saveOptions);
Methods
Process(LoadOptions, LockerSaveOptions)
.
public static void Process(LoadOptions loadOptions, LockerSaveOptions saveOptions)
Parameters
The re-saved file after being locked will always have the same format with the source file.
Class SpreadsheetMerger
Info
Merges multiple template files into one.
public class SpreadsheetMerger
Inheritance
object ←
SpreadsheetMerger
Inherited Members
Examples
[C#]
LoadOptions loadOptions = new LoadOptions();
list.Add(new LoadOptions() { InputFile = "template1.xlsx" });
list.Add(new LoadOptions() { InputFile = "template2.xlsx" });
SpreadsheetSaveOptions saveOptions = new SpreadsheetSaveOptions();
saveOptions.OutputFile = "merged.xlsx";
SpreadsheetMerger.Process(loadOptions, saveOptions,
new string[] { "template2.xlsx", "template2.xlsx", });
Methods
Process(LoadOptions, SaveOptions, string[])
public static void Process(LoadOptions loadOptions, SaveOptions saveOptions, string[] files)
Parameters
loadOptions
LoadOptions: Options for input and loading. Its input(Sheetize.LoadOptions.InputFile or Sheetize.LoadOptions.InputStream): takes no effect because all inputs will be specified by “files” parameter.saveOptions
SaveOptions: Options for output and saving:files
string[]: All template files to be merged
Process(LoadOptions, SaveOptions, AbstractLoadOptionsProvider)
public static void Process(LoadOptions loadOptions, SaveOptions saveOptions, AbstractLoadOptionsProvider provider)
Parameters
loadOptions
LoadOptions: Options for loading. Its input(Sheetize.LoadOptions.InputFile or Sheetize.LoadOptions.InputStream): takes no effect because all inputs will be specified by “provider” parameter.saveOptions
SaveOptions: Options for output and saving:provider
AbstractLoadOptionsProvider: Provider of load options for getting inputs to be merged
Class SpreadsheetSaveOptions
Info
Options for saving spreadsheet.
public class SpreadsheetSaveOptions : SaveOptions
Inheritance
object ←
SaveOptions ←
SpreadsheetSaveOptions
Inherited Members
- SaveOptions.OutputFile,
- SaveOptions.OutputStream,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
SpreadsheetSaveOptions()
public SpreadsheetSaveOptions()
Properties
Gets and sets the format of spreadsheet.
public FileFormatType SaveFormat { get; set; }
Property Value
FileFormatType
Class SpreadsheetSignature
Info
Adds/Removes signature for spreadsheet file.
public class SpreadsheetSignature
Inheritance
object ←
SpreadsheetSignature
Inherited Members
Methods
Process(LoadOptions, SignatureSaveOptions)
public static void Process(LoadOptions loadOptions, SignatureSaveOptions saveOptions)
Parameters
Class SpreadsheetSplitter
Info
Splits spreadsheet file into multiple parts.
public class SpreadsheetSplitter
Inheritance
object ←
SpreadsheetSplitter
Inherited Members
Examples
[C#]
LoadOptions loadOptions = new LoadOptions();
loadOptions.InputFile = "Template.xlsx";
SpreadsheetSaveOptions saveOptions = new SpreadsheetSaveOptions();
SpreadsheetSplitter.Process(loadOptions, saveOptions);
Methods
Process(LoadOptions, SplitterSaveOptions)
public static void Process(LoadOptions loadOptions, SplitterSaveOptions saveOptions)
Parameters
If the save options has specified Stream as output,
then all split parts will be saved to the same Stream.
Otherwise, the output files will be build from the specified output file by
appending sequence number of the sheet and split part.
For example, if the specified output file is Split.xlsx, then the generated
files will be Split_0_0.xlsx, Split_0_1.xlsx, …, Split_1_0.xlsx, …
Process(LoadOptions, SplitterSaveOptions, AbstractSaveOptionsProvider)
public static void Process(LoadOptions loadOptions, SplitterSaveOptions saveOptions, AbstractSaveOptionsProvider provider)
Parameters
loadOptions
LoadOptions: Options for input and loading:saveOptions
SplitterSaveOptions: Options for saving. Its output(Sheetize.SaveOptions.OutputFile or Sheetize.SaveOptions.OutputStream): takes no effect because all outputs will be specified by the “provider” parameter:provider
AbstractSaveOptionsProvider: Provider of save options for saving split parts
Class SpreadsheetUnlocker
Info
Unlocks spreadsheet file.
public class SpreadsheetUnlocker
Inheritance
object ←
SpreadsheetUnlocker
Inherited Members
Examples
[C#]
UnlockerLoadOptions loadOptions = new UnlockerLoadOptions();
loadOptions.InputFile = "Template.xlsx";
loadOptions.Password = "password to open file";
SaveOptions saveOptions = new SaveOptions();
saveOptions.OutputFile = "res.xlsx";
SpreadsheetUnlocker.Process(loadOptions, saveOptions);
Methods
Process(UnlockerLoadOptions, SaveOptions)
public static void Process(UnlockerLoadOptions loadOptions, SaveOptions saveOptions)
Parameters
The re-saved file after being unlocked will always have the same format with the source file.
Class TextConverter
Info
Converter for conversion between text based formats(csv, markdown, dif…) and other spreadsheet file formats.
public class TextConverter
Inheritance
object ←
TextConverter
Inherited Members
Examples
[C#]
LoadOptions loadOptions = new LoadOptions();
loadOptions.InputFile = "Template.csv";
TextSaveOptions saveOptions = new TextSaveOptions();
saveOptions.OutputFile = "res.xlsx";
TextConverter.Process(loadOptions, saveOptions);
Methods
Process(LoadOptions, SaveOptions)
Converts file format between text based formats and other spreadsheet file formats
public static void Process(LoadOptions loadOptions, SaveOptions saveOptions)
Parameters
Class TextSaveOptions
Info
Options for saving .SQL,.MD, .CSV, .TSV, .TXT, .XML, .DIF.
public class TextSaveOptions : SaveOptions
Inheritance
object ←
SaveOptions ←
TextSaveOptions
Inherited Members
- SaveOptions.OutputFile,
- SaveOptions.OutputStream,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
TextSaveOptions()
Properties
SaveFormat
Gets and sets the format of spreadsheet.
public FileFormatType SaveFormat { get; set; }
Property Value
FileFormatType
Class UnlockerLoadOptions
Info
Options to unlock excel files.
public class UnlockerLoadOptions : LoadOptions
Inheritance
object ←
LoadOptions ←
UnlockerLoadOptions
Inherited Members
- LoadOptions.InputFile,
- LoadOptions.InputStream,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
UnlockerLoadOptions()
public UnlockerLoadOptions()
Properties
Password
Password to open the file.
public string Password { get; set; }
Property Value
string
PasswordOfWorkbookProtection
Password to protect the workbook. If it is null, workbook protection will be kept without change.
public string PasswordOfWorkbookProtection { get; set; }
Property Value
string
PasswordOfWriteProtection
Password to modify the file. If it is null, write protection will be kept without change.
public string PasswordOfWriteProtection { get; set; }
Property Value
string
Methods
GetPasswordOfWorksheetProtection(SplitPartInfo)
Gets the password to unprotect one worksheet.
public virtual string GetPasswordOfWorksheetProtection(SplitPartInfo info)
Parameters
info
SplitPartInfo: Infomation about current sheet which needs to be unprotected.
Returns
string : the password to unprotect current sheet. If it is null, protection of current sheet will be kept without change.
Enum ExceptionType
Info
Represents custom exception type code.
public enum ExceptionType
Fields
Chart = 0
: Invalid chart setting.ConditionalFormatting = 3
: Invalid data validation setting.DataType = 1
: Invalid data type setting.DataValidation = 2
: Invalid data validation setting.FileCorrupted = 23
: File content is corrupted.FileFormat = 4
: Invalid file format.Formula = 5
: Invalid formula.IO = 18
: The file is invalid.IncorrectPassword = 8
: Incorrect password.Interrupted = 17
: The process is interrupted.InvalidData = 6
: Invalid data.InvalidOperator = 7
: Invalid operator.License = 9
: License related errors.Limitation = 10
: Out of MS Excel limitation error.PageSetup = 11
: Invalid page setup setting.Permission = 19
: Permission is required to open this file.PivotTable = 12
: Invalid pivotTable setting.Shape = 13
: Invalid drawing object setting.SheetName = 15
: Invalid worksheet name.SheetType = 16
: Invalid worksheet type.Sparkline = 14
: Invalid sparkline object setting.UndisclosedInformation = 22
: Files contains some undisclosed information.UnsupportedFeature = 20
: Unsupported feature.UnsupportedStream = 21
: Unsupported stream to be opened.
Info
Represents the supported file formats for conversion.
public enum FileFormatType
Fields
Auto = 0
: If saving the file to the disk,the file format accords to the extension of the file name. If saving the file to the stream, the file format is xlsx.Azw3 = 773
: Represents Azw3 file.Bmp = 263
: Windows BitmapCsv = 1
: Comma-Separated Values(CSV) text file.Dif = 30
: Data Interchange Format.Docx = 62
: Represents .docx file.Emf = 258
: Windows Enhanced Metafile.Epub = 772
: Represents Epub file.Excel97To2003 = 5
: Represents an Excel97-2003 xls file.Fods = 59
: Represents OpenDocument Flat XML Spreadsheet (.fods) file format.Gif = 322
: GifHtml = 12
: Represents a html file.Jpg = 261
: JPEG JFIF.Json = 513
: JsonMHtml = 17
: Represents a mhtml file.Markdown = 57
: Represents markdown document.Numbers09 = 56
: Represents Numbers 9.0 file format by Apple Inc.Numbers35 = 62
: Represents Numbers 3.5 file format since 2014 by Apple IncOds = 14
: Open Document Sheet(ODS) file.Ots = 31
: Open Document Template Sheet(OTS) file.Pdf = 13
: Represents a Pdf file.Png = 262
: Portable Network Graphics.Pptx = 61
: Represents .pptx file.SpreadsheetML = 15
: Represents an Excel 2003 xml file.SqlScript = 514
: SqlSvg = 28
: SVG file.Sxc = 60
: Represents StarOffice Calc Spreadsheet (.sxc) file format.TabDelimited = 11
: Represents a tab delimited text file, same with Sheetize.FileFormatType.Tsv.Tiff = 21
: Represents a TIFF file.Tsv = 11
: Tab-Separated Values(TSV) text file.Unknown = 255
: Represents unrecognized format, cannot be saved.XHtml = 771
: Represents XHtml file.Xlam = 10
: Represents an xltm file which enable add-in macros.Xlsb = 16
: Represents an xlsb file.Xlsm = 7
: Represents an xlsm file which enable macros.Xlsx = 6
: Represents an xlsx file.Xlt = 32
: Excel 97-2003 template file.Xltm = 9
: Represents an xltm file which enable macros.Xltx = 8
: Represents an xltx file.Xml = 51
: Represents a simple xml file.Xps = 20
: XPS (XML Paper Specification) format.
Enum ImageType
Info
Specifies the type (format) of an image.
Fields
Bmp = 7
: Windows BitmapEmf = 2
: Windows Enhanced Metafile.Gif = 66
: GifJpeg = 5
: JPEG JFIF.OfficeCompatibleEmf = 71
: Windows Enhanced Metafile which is more compatible with Office.Pict = 4
: Macintosh PICT.Png = 6
: Portable Network Graphics.Svg = 68
: SvgSvm = 69
: SvmTiff = 67
: TiffUnknown = 0
: An unknown image type.WebP = 72
: Weppy image formatWmf = 3
: Windows Metafile.
Enum ProtectionType
Info
Represents protection type of one excel file or one sheet in it.
public enum ProtectionType
Fields
All = 0
: Represents to protect all.Contents = 1
: Represents to protect contents, used in Worksheet protection.None = 6
: Represents no protection. Only for Reading property.Objects = 2
: Represents to protect objects, used in Worksheet protection.Scenarios = 3
: Represents to protect scenarios, used in Worksheet protection.Structure = 4
: Represents to protect structure, used in Workbook protection.Windows = 5
: Represents to protect window, used in Workbook protection.
Enum SignatureType
Info
Enum representing the type of signature
public enum SignatureType
Fields
WorkbookSignature = 0
: Represents a workbook signatureWorksheetSignature = 1
: Represents a worksheet signature