Class ApplicationImpl
XlsIO Application interface declaration.
Inheritance
Namespace: Syncfusion.XlsIO.Implementation
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class ApplicationImpl : Object, IApplication, IParentApplication
Constructors
ApplicationImpl(ExcelEngine)
Default constructor.
Declaration
public ApplicationImpl(ExcelEngine excelEngine)
Parameters
Type | Name | Description |
---|---|---|
ExcelEngine | excelEngine |
Fields
DEF_ARGUMENT_SEPARATOR
Argument separator.
Declaration
public const char DEF_ARGUMENT_SEPARATOR = ','
Field Value
Type |
---|
System.Char |
DEF_ROW_SEPARATOR
Row separator.
Declaration
public const char DEF_ROW_SEPARATOR = ';'
Field Value
Type |
---|
System.Char |
Properties
ActiveCell
Returns a Range object that represents the active cell in the active window (the window on top) or in the specified window. If the window isn't displaying a worksheet, this property fails. Read-only.
Declaration
public IRange ActiveCell { get; }
Property Value
Type |
---|
IRange |
ActiveSheet
Returns an object that represents the active sheet (the sheet on top) in the active workbook or in the specified window or workbook. Returns NULL (Nothing in VB) if no sheet is active. Read-only.
Declaration
public IWorksheet ActiveSheet { get; }
Property Value
Type |
---|
IWorksheet |
ActiveWorkbook
Returns a Workbook object that represents the workbook in the active window (the window on top). Read-only. Returns NULL (Nothing in VB) if there are no windows open or if either the Info window or the Clipboard window is the active window.
Declaration
public IWorkbook ActiveWorkbook { get; }
Property Value
Type |
---|
IWorkbook |
Application
Used without an object qualifier, this property returns an Application object that represents the Microsoft Excel application. Used with an object qualifier, this property returns an Application object that represents the creator of the specified object (you can use this property with an OLE Automation object to return that object's application). Read-only.
Declaration
public IApplication Application { get; }
Property Value
Type |
---|
IApplication |
ArgumentsSeparator
Formula arguments separator.
Declaration
public char ArgumentsSeparator { get; set; }
Property Value
Type |
---|
System.Char |
Build
Returns the Microsoft Excel build number. Read-only.
Declaration
public int Build { get; }
Property Value
Type |
---|
System.Int32 |
ChangeStyleOnCellEdit
When this property is set to True, if some cells have reference to the same style, changes will influence all these cells. Default value: FALSE.
Declaration
public bool ChangeStyleOnCellEdit { get; set; }
Property Value
Type |
---|
System.Boolean |
ChartToImageConverter
Represents the Chart to Image Converter instance. Returns null if it is not instantiated.
Declaration
public IChartToImageConverter ChartToImageConverter { get; set; }
Property Value
Type |
---|
IChartToImageConverter |
Remarks
This method is supported on Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms only.
CompressionLevel
Compression level for workbooks serialization.
Declaration
public Nullable<CompressionLevel> CompressionLevel { get; set; }
Property Value
Type |
---|
System.Nullable<CompressionLevel> |
CsvQualifier
Gets or sets the qualifier to put around the results with separator or record delimiter.
Declaration
public string CsvQualifier { get; set; }
Property Value
Type |
---|
System.String |
Remarks
In the above example, the CSV qualifier is set as "$" and the separator is (,). So, the G1 cell value "qualifier,text" will be surrounded by qualifier because it contains the separator while saving workbook as CSV document.
Output of the above code looks like this. This,is,a,sample,to,set,$qualifier,text$
If the results contain the qualifier, the qualifier is repeated. The Qualifier setting must be different from the Separator and RecordDelimiter settings. The default value is quotation (").
Examples
using(ExcelEngine engine = new ExcelEngine())
{
IApplication application = engine.Excel;
application.CsvQualifier ="$";
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
worksheet["A1"].Text = "This";
worksheet["B1"].Text = "is";
worksheet["C1"].Text = "a";
worksheet["D1"].Text = "sample";
worksheet["E1"].Text = "to";
worksheet["F1"].Text = "set";
worksheet["G1"].Text = "qualifier,text";
MemoryStream stream = new MemoryStream();
workbook.SaveAs(stream, ",", Encoding.Unicode);
}
CsvRecordDelimiter
Gets or sets the record delimiter to put at the end of each record.
Declaration
public string CsvRecordDelimiter { get; set; }
Property Value
Type |
---|
System.String |
Remarks
In the above example, CSV record delimiter is set as '$'. It will be added at the end of each row while saving workbook as CSV document.
Output of the above code looks like this. This,is,a,sample$ to,set,Record Delimiter$
The default value is Carriage Return(CR) and Line Feed(LF).
Examples
using(ExcelEngine engine = new ExcelEngine())
{
IApplication application = engine.Excel;
application.CsvRecordDelimiter ="$";
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
worksheet["A1"].Text = "This";
worksheet["B1"].Text = "is";
worksheet["C1"].Text = "a";
worksheet["D1"].Text = "sample";
worksheet["A2"].Text = "to";
worksheet["B2"].Text = "set";
worksheet["C2"].Text = "Record Delimiter";
MemoryStream stream = new MemoryStream();
workbook.SaveAs(stream, ",", Encoding.Unicode);
}
CSVSeparator
Represents CSV Separator.
Declaration
public string CSVSeparator { get; set; }
Property Value
Type |
---|
System.String |
DataProviderType
Changes data provider type for all operations after it. Static property.
Declaration
public ExcelDataProviderType DataProviderType { get; set; }
Property Value
Type |
---|
ExcelDataProviderType |
DataProviderTypeStatic
Changes data provider type for all operations after it. Static property.
Declaration
public static ExcelDataProviderType DataProviderTypeStatic { get; set; }
Property Value
Type |
---|
ExcelDataProviderType |
DebugInfo
Switch indicating whether to show debug information. Read-only.
Declaration
public static BooleanSwitch DebugInfo { get; }
Property Value
Type |
---|
System.Diagnostics.BooleanSwitch |
Remarks
This property is supported on Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms only.
DecimalSeparator
Sets or returns the character used for the decimal separator as a String. Read/write.
Declaration
public string DecimalSeparator { get; set; }
Property Value
Type |
---|
System.String |
DefaultFilePath
Returns or sets the default path that Microsoft Excel uses when it opens files. Read/write String.
Declaration
public string DefaultFilePath { get; set; }
Property Value
Type |
---|
System.String |
Remarks
This property is supported on Windows Forms, WPF, ASP.NET, ASP.NET MVC, WinRT, Windows Phone and Universal platforms only.
DefaultStyleNames
Default style names.
Declaration
public string[] DefaultStyleNames { get; }
Property Value
Type |
---|
System.String[] |
DefaultVersion
Gets / sets default excel version. This value is used in create methods.
Declaration
public ExcelVersion DefaultVersion { get; set; }
Property Value
Type |
---|
ExcelVersion |
DeleteDestinationFile
Indicates whether XlsIO should delete destination file before saving into it. Default value is TRUE.
Declaration
public bool DeleteDestinationFile { get; set; }
Property Value
Type |
---|
System.Boolean |
EnableIncrementalFormula
Specifies whether to increment the references in formula automatically. Default value is false.
Declaration
public bool EnableIncrementalFormula { get; set; }
Property Value
Type |
---|
System.Boolean |
EnablePartialTrustCode
Specifies whether to run Partial trust code.
Declaration
public bool EnablePartialTrustCode { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
True if to run partial trust code; otherwise, false.
ExcludeAdditionalCharacters
Flag to ignore exception and exclude characters more than 32767 (maximum allowed characters) in a cell text.
Declaration
public bool ExcludeAdditionalCharacters { get; set; }
Property Value
Type |
---|
System.Boolean |
FallbackFonts
Gets a Fallback font collection.
Declaration
public FallbackFonts FallbackFonts { get; }
Property Value
Type |
---|
FallbackFonts |
FixedDecimal
All data entered after this property is set to True will be formatted with the number of fixed decimal places set by the FixedDecimalPlaces property. Read/write Boolean.
Declaration
public bool FixedDecimal { get; set; }
Property Value
Type |
---|
System.Boolean |
FixedDecimalPlaces
Returns or sets the number of fixed decimal places used when the FixedDecimal property is set to True. Read/write.
Declaration
public int FixedDecimalPlaces { get; set; }
Property Value
Type |
---|
System.Int32 |
IgnoreSheetNameException
Declaration
public bool IgnoreSheetNameException { get; set; }
Property Value
Type |
---|
System.Boolean |
IsChartCacheEnabled
Gets or sets a boolean value which indicates whether the chart caches are enabled or not Default value is false.
Declaration
public bool IsChartCacheEnabled { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
If set "true" XlsIO will give parsing and serializing support for chart caches which lead some performance delay and memory consumption
Some spreadsheet viewer requires chart caches to view the chart.
This method is supported on Windows Forms, WPF, ASP.NET, ASP.NET MVC, WinRT, Windows Phone, Universal and UWP platforms only.IsDebugInfoEnabled
Indicates whether debug info is enabled. Read-only.
Declaration
public static bool IsDebugInfoEnabled { get; set; }
Property Value
Type |
---|
System.Boolean |
IsFormulaParsed
Indicates whether the formula is parsed.
Declaration
public bool IsFormulaParsed { get; set; }
Property Value
Type |
---|
System.Boolean |
IsSaved
If True, no changes were made since last save.
Declaration
public bool IsSaved { get; }
Property Value
Type |
---|
System.Boolean |
MaximumColumnsForCsv
Get or set maximum columns for CSV file.
Declaration
public int MaximumColumnsForCsv { get; set; }
Property Value
Type |
---|
System.Int32 |
MaximumRowsForCsv
Get or set maximum rows for CSV file.
Declaration
public int MaximumRowsForCsv { get; set; }
Property Value
Type |
---|
System.Int32 |
OptimizeFonts
Indicates whether to optimize fonts count. This option will take effect only on workbooks that will be added after setting this property. WARNING: Setting this property to True can decrease performance significantly, but will reduce resulting file size.
Declaration
public bool OptimizeFonts { get; set; }
Property Value
Type |
---|
System.Boolean |
OptimizeImport
Indicates whether to optimize Import data. This option will take effect only on Import methods that are available with the worksheet WARNING: Setting this property to True can decrease memory significantly, but will increase the performance of data import .
Declaration
public bool OptimizeImport { get; set; }
Property Value
Type |
---|
System.Boolean |
Parent
Returns the parent object for the specified object. Read-only.
Declaration
public object Parent { get; }
Property Value
Type |
---|
System.Object |
PathSeparator
Returns the path separator character (""). Read-only String.
Declaration
public string PathSeparator { get; }
Property Value
Type |
---|
System.String |
Remarks
This property is supported on Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms only.
PreserveCSVDataTypes
Indicates whether to preserve the datatypes for the CSV file formats.
Declaration
public bool PreserveCSVDataTypes { get; set; }
Property Value
Type |
---|
System.Boolean |
Range
Returns a Range object that represents a cell or a range of cells. Read-only.
Declaration
public IRange Range { get; }
Property Value
Type |
---|
IRange |
RangeIndexerMode
Specifies whether the range should be accessed from worksheet or within the range object scope..
Declaration
public ExcelRangeIndexerMode RangeIndexerMode { get; set; }
Property Value
Type |
---|
ExcelRangeIndexerMode |
Examples
The following code illustrates how to change range indexer mode by this property.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.RangeIndexerMode = ExcelRangeIndexerMode.Relative;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];
IRange range = sheet.Range["A5:C7"];
IRange relativeRange = range[2, 2];
string fileName = "RelativeRangeIndexer.xlsx";
workbook.SaveAs(fileName);
workbook.Close();
excelEngine.Dispose();
RowSeparator
Gets / sets row separator for array parsing.
Declaration
public char RowSeparator { get; set; }
Property Value
Type |
---|
System.Char |
RowStorageAllocationBlockSize
Gets / sets memory allocation block for single row. Each row will allocate memory block that can be divided on this number. Smaller value means smaller memory usage but slower speed when changing cell's value. Default value is 128. That is enough to allocate 9 string records, or 9 integer numbers (or floating numbers with 1 or 2 digits after decimal point) or 7 double numbers.
Declaration
public int RowStorageAllocationBlockSize { get; set; }
Property Value
Type |
---|
System.Int32 |
SheetsInNewWorkbook
Returns or sets the number of sheets that Microsoft Excel automatically inserts into new workbooks. Read/write Long.
Declaration
public int SheetsInNewWorkbook { get; set; }
Property Value
Type |
---|
System.Int32 |
SkipAutoFitRow
Declaration
public bool SkipAutoFitRow { get; set; }
Property Value
Type |
---|
System.Boolean |
SkipOnSave
Flags that control behavior of workbook save methods. Each flag controls one aspect of save code. Can be set one or more flags influencing the output produced.
Declaration
public SkipExtRecords SkipOnSave { get; set; }
Property Value
Type |
---|
SkipExtRecords |
StandardFont
Returns or sets the name of the standard font. Read/write String.
Declaration
public string StandardFont { get; set; }
Property Value
Type |
---|
System.String |
StandardFontSize
Returns or sets the standard font size, in points. Read/write.
Declaration
public double StandardFontSize { get; set; }
Property Value
Type |
---|
System.Double |
StandardHeight
Returns or sets the standard (default) height of all the rows in the worksheet, in points. Read/write Double.
Declaration
public double StandardHeight { get; set; }
Property Value
Type |
---|
System.Double |
StandardHeightFlag
Returns or sets the standard (default) height option flag, which defines that standard (default) row height and book default font height do not match. Read/write Bool.
Declaration
public bool StandardHeightFlag { get; set; }
Property Value
Type |
---|
System.Boolean |
StandardHeightInRowUnits
Returns standard row height in units used by RowRecord.
Declaration
public int StandardHeightInRowUnits { get; }
Property Value
Type |
---|
System.Int32 |
StandardWidth
Returns or sets the standard (default) width of all the columns in the worksheet. Read/write Double.
Declaration
public double StandardWidth { get; set; }
Property Value
Type |
---|
System.Double |
ThousandsSeparator
Sets or returns the character used for the thousands separator as a String. Read/write
Declaration
public string ThousandsSeparator { get; set; }
Property Value
Type |
---|
System.String |
UpdateSheetFormulaReference
Specifies whether to remove worksheet reference in formulas on removing and reattaching the worksheet. Default value is TRUE.
Declaration
public bool UpdateSheetFormulaReference { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
Updates the worksheet reference in formulas while removing the worksheet. Default value is TRUE. Setting UpdateSheetFormulaReference to FALSE while removing the worksheet, will retain the sheet name in the formulas. If worksheet with same name is created, then the formula will refer the new worksheet with that name.
Examples
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create a worksheet.
IApplication application = excelEngine.Excel;
// Ignores removal of worksheet reference in the formulas while removing the worksheet.
application.UpdateSheetFormulaReference = false;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(2);
IWorksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].Formula = "Sheet2!A1";
workbook.Worksheets["Sheet2"].Remove();
workbook.Worksheets.Create("Sheet2");
string formula = sheet.Range["A1"].Formula;
workbook.SaveAs("Output.xlsx");
workbook.Close();
}
UseFastRecordParsing
Indicates whether to try fast record parsing.
Declaration
public bool UseFastRecordParsing { get; set; }
Property Value
Type |
---|
System.Boolean |
UseNativeOptimization
Indicates is use unsafe code.
Declaration
public bool UseNativeOptimization { get; set; }
Property Value
Type |
---|
System.Boolean |
UseNativeStorage
Indicates whether we should use native storage (standard windows COM object) or our .Net implementation to open excel 97-2003 files.
Declaration
public bool UseNativeStorage { get; set; }
Property Value
Type |
---|
System.Boolean |
UserName
Returns or sets the name of the current user. Read/write String.
Declaration
public string UserName { get; set; }
Property Value
Type |
---|
System.String |
UseStringDelimiter
Gets or sets a boolean value indicating whether to add string delimiter for all the text values. Default value is FALSE.
Declaration
public bool UseStringDelimiter { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
In the above example, cell A1 contains a text value. So, it will be surrounded by string delimiter i.e., double quotes while saving workbook as CSV document.
Output of the above code looks like this. "Document",6
Examples
using(ExcelEngine engine = new ExcelEngine())
{
IApplication application = engine.Excel;
application.UseStringDelimiter = true;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
worksheet["A1"].Text = "Document";
worksheet["B1"].Value = "6";
MemoryStream stream = new MemoryStream();
workbook.SaveAs(stream, ",",Encoding.Unicode);
}
UseSystemSeparators
True (default) if the system separators of Microsoft Excel are enabled. Read/write Boolean.
Declaration
public bool UseSystemSeparators { get; set; }
Property Value
Type |
---|
System.Boolean |
UseUnsafeCodeStatic
Indicates is use unsafe code. Static property.
Declaration
public static bool UseUnsafeCodeStatic { get; set; }
Property Value
Type |
---|
System.Boolean |
Value
For the Application object, it always returns "Microsoft Excel". For the CubeField object, the name of the specified field. For the Style object, the name of the specified style. Read-only String.
Declaration
public string Value { get; }
Property Value
Type |
---|
System.String |
Workbooks
Returns a Workbooks collection that represents all the open workbooks. Read-only.
Declaration
public IWorkbooks Workbooks { get; }
Property Value
Type |
---|
IWorkbooks |
Worksheets
For an Application object, returns a Sheets collection that represents all worksheets in the active workbook. For a Workbook object, returns a Sheets collection that represents all the worksheets in the specified workbook. Read-only Sheets object.
Declaration
public IWorksheets Worksheets { get; }
Property Value
Type |
---|
IWorksheets |
Methods
add_OnPasswordRequired(PasswordRequiredEventHandler)
Declaration
public void add_OnPasswordRequired(PasswordRequiredEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
PasswordRequiredEventHandler | value |
add_OnWrongPassword(PasswordRequiredEventHandler)
Declaration
public void add_OnWrongPassword(PasswordRequiredEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
PasswordRequiredEventHandler | value |
add_ProgressEvent(ProgressEventHandler)
Declaration
public void add_ProgressEvent(ProgressEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ProgressEventHandler | value |
add_SubstituteFont(SubstituteFontEventHandler)
Declaration
public void add_SubstituteFont(SubstituteFontEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SubstituteFontEventHandler | value |
add_TypeMismatchOnExport(ExportEventHandler)
Declaration
public void add_TypeMismatchOnExport(ExportEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ExportEventHandler | value |
CentimetersToPoints(Double)
Converts a measurement from centimeters to points (one point equals 0.035 centimeters).
Declaration
public double CentimetersToPoints(double Centimeters)
Parameters
Type | Name | Description |
---|---|---|
System.Double | Centimeters | Value in centimeters to convert. |
Returns
Type | Description |
---|---|
System.Double | Converted value. |
CheckDefaultFont()
This method should be called before creating font. Sets default font name and size.
Declaration
public void CheckDefaultFont()
ConvertUnits(Double, MeasureUnits, MeasureUnits)
Converts units.
Declaration
public double ConvertUnits(double value, MeasureUnits from, MeasureUnits to)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value to convert. |
MeasureUnits | from | Form option. |
MeasureUnits | to | To option. |
Returns
Type | Description |
---|---|
System.Double | Returns converted result. |
ConvertUnitsStatic(Double, MeasureUnits, MeasureUnits)
Converts units.
Declaration
public static double ConvertUnitsStatic(double value, MeasureUnits from, MeasureUnits to)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value to convert. |
MeasureUnits | from | Form option. |
MeasureUnits | to | To option. |
Returns
Type | Description |
---|---|
System.Double | Returns converted result. |
CreateChart(Object)
Creates a new chart.
Declaration
public virtual ChartImpl CreateChart(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent |
Returns
Type | Description |
---|---|
ChartImpl | The created chart object. |
CreateCheckBoxShapeImpl(Object)
Creates new instance of the checkbox shape.
Declaration
public CheckBoxShapeImpl CreateCheckBoxShapeImpl(object shapesCollection)
Parameters
Type | Name | Description |
---|---|---|
System.Object | shapesCollection | Parent shapes collection. |
Returns
Type | Description |
---|---|
CheckBoxShapeImpl | Created checkbox shape. |
CreateComboBoxShapeImpl(Object)
Creates new instance of the combobox shape.
Declaration
public ComboBoxShapeImpl CreateComboBoxShapeImpl(object shapesCollection)
Parameters
Type | Name | Description |
---|---|---|
System.Object | shapesCollection | Parent shapes collection. |
Returns
Type | Description |
---|---|
ComboBoxShapeImpl | Created checkbox shape. |
CreateCommentShapeImpl(Object)
Initialize new CommentShapeImpl.
Declaration
public virtual CommentShapeImpl CreateCommentShapeImpl(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new CommentShapeImpl. |
Returns
Type | Description |
---|---|
CommentShapeImpl | Newly created CommentShapeImpl. |
CreateCommentShapeImpl(Object, MsofbtSpContainer)
Initialize new CommentShapeImpl.
Declaration
public virtual CommentShapeImpl CreateCommentShapeImpl(object parent, MsofbtSpContainer container)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new CommentShapeImpl. |
MsofbtSpContainer | container | Parent MsofbtSpContainer for the new CommentShapeImpl. |
Returns
Type | Description |
---|---|
CommentShapeImpl | Newly created CommentShapeImpl. |
CreateCommentShapeImpl(Object, MsofbtSpContainer, ExcelParseOptions)
Initialize new CommentShapeImpl.
Declaration
public virtual CommentShapeImpl CreateCommentShapeImpl(object parent, MsofbtSpContainer container, ExcelParseOptions options)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new CommentShapeImpl. |
MsofbtSpContainer | container | Parent MsofbtSpContainer for the new CommentShapeImpl. |
ExcelParseOptions | options | Parse options. |
Returns
Type | Description |
---|---|
CommentShapeImpl | Newly created CommentShapeImpl. |
CreateCommentShapeImpl(Object, Boolean)
Initialize new CommentShapeImpl.
Declaration
public virtual CommentShapeImpl CreateCommentShapeImpl(object parent, bool bIsParseOptions)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new CommentShapeImpl. |
System.Boolean | bIsParseOptions | Indicates is parse comment fill line options. |
Returns
Type | Description |
---|---|
CommentShapeImpl | Newly created CommentShapeImpl. |
CreateCommentsRange(IRange)
Initialize new ComentsRange.
Declaration
public virtual CommentsRange CreateCommentsRange(IRange parentRange)
Parameters
Type | Name | Description |
---|---|---|
IRange | parentRange | Parent Range for the new CommentRange. |
Returns
Type | Description |
---|---|
CommentsRange | Newly created ComentsRange. |
CreateCompressor(Stream)
Creates the Compressor.
Declaration
public virtual Stream CreateCompressor(Stream outputStream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | outputStream |
Returns
Type |
---|
System.IO.Stream |
CreateCondFormatCollectionWrapper(ICombinedRange)
Creates collection with specified argument.
Declaration
public virtual CondFormatCollectionWrapper CreateCondFormatCollectionWrapper(ICombinedRange range)
Parameters
Type | Name | Description |
---|---|---|
ICombinedRange | range |
Returns
Type |
---|
CondFormatCollectionWrapper |
CreateConditionalFormats(Object, CondFmt12Record, IList)
Creates ConditionalFormats collection from array of BiffRecords.
Declaration
public virtual ConditionalFormats CreateConditionalFormats(object parent, CondFmt12Record format, IList formats)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the collection. |
CondFmt12Record | format | Main conditional format12 record. |
System.Collections.IList | formats | Array of CF12Records with conditional formats. |
Returns
Type |
---|
ConditionalFormats |
CreateConditionalFormats(Object, CondFMTRecord, IList, IList)
Creates ConditionalFormats collection from array of BiffRecords.
Declaration
public virtual ConditionalFormats CreateConditionalFormats(object parent, CondFMTRecord format, IList formats, IList CFExRecords)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the collection. |
CondFMTRecord | format | Main conditional format record. |
System.Collections.IList | formats | Array of CFRecords with conditional formats. |
System.Collections.IList | CFExRecords |
Returns
Type |
---|
ConditionalFormats |
CreateDataProvider(IntPtr)
Creates intptr data provider.
Declaration
public static DataProvider CreateDataProvider(IntPtr heapHandle)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | heapHandle |
Returns
Type | Description |
---|---|
DataProvider | New instance of created data provider. |
CreateDataValidationArrayImpl(IRange)
Initialize new DataValidationArrayImpl.
Declaration
public virtual DataValidationArray CreateDataValidationArrayImpl(IRange parent)
Parameters
Type | Name | Description |
---|---|---|
IRange | parent | Parent object for the new DataValidationArrayImpl. |
Returns
Type | Description |
---|---|
DataValidationArray | Newly created DataValidationArrayImpl. |
CreateDataValidationImpl(DataValidationCollection)
Initialize new DataValidationImpl.
Declaration
public virtual DataValidationImpl CreateDataValidationImpl(DataValidationCollection parent)
Parameters
Type | Name | Description |
---|---|---|
DataValidationCollection | parent | Parent object for the new DataValidationImpl. |
Returns
Type | Description |
---|---|
DataValidationImpl | Newly created DataValidationImpl. |
CreateDataValidationImpl(DataValidationCollection, DVRecord)
Initialize new DataValidationImpl.
Declaration
public virtual DataValidationImpl CreateDataValidationImpl(DataValidationCollection parent, DVRecord dv)
Parameters
Type | Name | Description |
---|---|---|
DataValidationCollection | parent | Parent object for the new DataValidationImpl. |
DVRecord | dv | Base DVRecord for the new DataValidationImpl. |
Returns
Type | Description |
---|---|
DataValidationImpl | Newly created DataValidationImpl. |
CreateDataValidationWrapper(RangeImpl, DataValidationImpl)
Initialize new DataValidationWrapper.
Declaration
public virtual DataValidationWrapper CreateDataValidationWrapper(RangeImpl range, DataValidationImpl wrap)
Parameters
Type | Name | Description |
---|---|---|
RangeImpl | range | Parent Range for the new DataValidationWrapper. |
DataValidationImpl | wrap | Parent DataValidationImpl for the new DataValidationWrapper. |
Returns
Type | Description |
---|---|
DataValidationWrapper | Newly created DataValidationWrapper. |
CreateFont(IFont)
Creates new font.
Declaration
public virtual FontImpl CreateFont(IFont basedOn)
Parameters
Type | Name | Description |
---|---|---|
IFont | basedOn | Base font for the new one. |
Returns
Type | Description |
---|---|
FontImpl | Newly created font. |
CreateFont(Object)
Creates new font.
Declaration
public virtual FontImpl CreateFont(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new font. |
Returns
Type | Description |
---|---|
FontImpl | Newly created font. |
CreateFont(Object, FontImpl)
Creates new font.
Declaration
public virtual FontImpl CreateFont(object parent, FontImpl font)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new font. |
FontImpl | font | Font object that contains font information. |
Returns
Type | Description |
---|---|
FontImpl | Newly created font. |
CreateFont(Object, FontRecord)
Creates new font.
Declaration
public virtual FontImpl CreateFont(object parent, FontRecord font)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new font. |
FontRecord | font | Font record that contains font information. |
Returns
Type | Description |
---|---|
FontImpl | Newly created font. |
CreateFont(Object, Font)
Method creates a font object based on native font and register it in the workbook.
Declaration
public virtual FontImpl CreateFont(object parent, Font nativeFont)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new font. |
System.Drawing.Font | nativeFont | Native font to get settings from. |
Returns
Type | Description |
---|---|
FontImpl | Newly created font. |
Remarks
This method is supported on Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms only.
CreateHyperLink(Object)
Initializes new hyperlink.
Declaration
public virtual HyperLinkImpl CreateHyperLink(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new hyperlink. |
Returns
Type | Description |
---|---|
HyperLinkImpl | Newly created hyperlink. |
CreateHyperLink(Object, IRange)
Initializes new hyperlink.
Declaration
public virtual HyperLinkImpl CreateHyperLink(object parent, IRange range)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new hyperlink. |
IRange | range | Hyperlink range. |
Returns
Type | Description |
---|---|
HyperLinkImpl | Newly created hyperlink. |
CreateImage(Stream)
Create image from stream.
Declaration
public static Image CreateImage(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream |
Returns
Type |
---|
System.Drawing.Image |
CreateOptionButtonShapeImpl(Object)
Creates new instance of the OptionButton shape.
Declaration
public OptionButtonShapeImpl CreateOptionButtonShapeImpl(object shapesCollection)
Parameters
Type | Name | Description |
---|---|---|
System.Object | shapesCollection | Parent shapes collection. |
Returns
Type | Description |
---|---|
OptionButtonShapeImpl | Created OptionButton shape. |
CreateRange(Object)
Creates a new Range.
Declaration
public virtual RangeImpl CreateRange(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new range. |
Returns
Type | Description |
---|---|
RangeImpl | Newly created range. |
CreateRange(Object, BiffRecordRaw, Boolean)
Creates a new Range.
Declaration
public virtual RangeImpl CreateRange(object parent, BiffRecordRaw record, bool bIgnoreStyles)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new range. |
Syncfusion.XlsIO.Parser.Biff_Records.BiffRecordRaw | record | Range record to parse. |
System.Boolean | bIgnoreStyles | Indicates whether styles should be ignored. |
Returns
Type | Description |
---|---|
RangeImpl | Newly created range. |
CreateRange(Object, BiffRecordRaw[], ref Int32)
Creates a new Range.
Declaration
public virtual RangeImpl CreateRange(object parent, BiffRecordRaw[] data, ref int i)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new range. |
Syncfusion.XlsIO.Parser.Biff_Records.BiffRecordRaw[] | data | Array of BiffRecordRaws that contains range data. |
System.Int32 | i | Index of the range record. |
Returns
Type | Description |
---|---|
RangeImpl | Newly created range. |
CreateRange(Object, BiffRecordRaw[], ref Int32, Boolean)
Creates a new Range.
Declaration
public virtual RangeImpl CreateRange(object parent, BiffRecordRaw[] data, ref int i, bool ignoreStyles)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new range. |
Syncfusion.XlsIO.Parser.Biff_Records.BiffRecordRaw[] | data | Array of BiffRecordRaws that contains range data. |
System.Int32 | i | Index of the range record. |
System.Boolean | ignoreStyles | Indicates whether cell styles should be ignored. |
Returns
Type | Description |
---|---|
RangeImpl | Newly created range. |
CreateRange(Object, List<BiffRecordRaw>, ref Int32, Boolean)
Creates a new Range.
Declaration
public virtual RangeImpl CreateRange(object parent, List<BiffRecordRaw> data, ref int i, bool ignoreStyles)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new range. |
System.Collections.Generic.List<Syncfusion.XlsIO.Parser.Biff_Records.BiffRecordRaw> | data | Array of BiffRecordRaws that contains range data. |
System.Int32 | i | Index of the range record. |
System.Boolean | ignoreStyles | Indicates whether cell styles should be ignored. |
Returns
Type | Description |
---|---|
RangeImpl | Newly created range. |
CreateRange(Object, Int32, Int32)
Creates new range for a single cell.
Declaration
public virtual RangeImpl CreateRange(object parent, int col, int row)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new range. |
System.Int32 | col | Column index for the new range. |
System.Int32 | row | Row index for the new range. |
Returns
Type | Description |
---|---|
RangeImpl | Newly created range. |
CreateRange(Object, Int32, Int32, Int32, Int32)
Creates a new Range.
Declaration
public virtual RangeImpl CreateRange(object parent, int firstCol, int firstRow, int lastCol, int lastRow)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new range. |
System.Int32 | firstCol | First column of the range. |
System.Int32 | firstRow | First row of the range. |
System.Int32 | lastCol | Last column of the range. |
System.Int32 | lastRow | Last row of the range. |
Returns
Type | Description |
---|---|
RangeImpl | Newly created range. |
CreateRangesCollection(Object)
Creates new instance of RangesCollection.
Declaration
public RangesCollection CreateRangesCollection(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the collection. |
Returns
Type | Description |
---|---|
RangesCollection | Newly created collection. |
CreateSerie(Object)
Creates a chart series object.
Declaration
public virtual ChartSerieImpl CreateSerie(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent |
Returns
Type | Description |
---|---|
ChartSerieImpl | The created chart series object. |
CreateStyle(WorkbookImpl, StyleRecord)
Creates a new Style.
Declaration
public virtual StyleImpl CreateStyle(WorkbookImpl parent, StyleRecord style)
Parameters
Type | Name | Description |
---|---|---|
WorkbookImpl | parent | Parent object for the new style object. |
StyleRecord | style | Style record with style information. |
Returns
Type | Description |
---|---|
StyleImpl | Newly created style. |
CreateStyle(WorkbookImpl, String)
Creates a new Style.
Declaration
public virtual StyleImpl CreateStyle(WorkbookImpl parent, string name)
Parameters
Type | Name | Description |
---|---|---|
WorkbookImpl | parent | Parent object for the new style object. |
System.String | name | Name of the new style. |
Returns
Type | Description |
---|---|
StyleImpl | Newly created style. |
CreateStyle(WorkbookImpl, String, StyleImpl)
Creates a new Style.
Declaration
public virtual StyleImpl CreateStyle(WorkbookImpl parent, string name, StyleImpl basedOn)
Parameters
Type | Name | Description |
---|---|---|
WorkbookImpl | parent | Parent object for the new style object. |
System.String | name | Name of the new style. |
StyleImpl | basedOn | Base style for this style. |
Returns
Type | Description |
---|---|
StyleImpl | Newly created style. |
CreateStyle(WorkbookImpl, String, Boolean)
Creates a new Style.
Declaration
public virtual StyleImpl CreateStyle(WorkbookImpl parent, string name, bool bIsBuildIn)
Parameters
Type | Name | Description |
---|---|---|
WorkbookImpl | parent | Parent object for the new style object. |
System.String | name | Name of the new style.> |
System.Boolean | bIsBuildIn | Indicates whether built in style should be created. |
Returns
Type |
---|
StyleImpl |
CreateTemplateMarkers(Object)
Creates object that can be used for template markers processing.
Declaration
public TemplateMarkersImpl CreateTemplateMarkers(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new instance. |
Returns
Type | Description |
---|---|
TemplateMarkersImpl | Object that can be used for template markers processing. |
CreateWorkbook(Object, ExcelVersion)
Creates a new Workbook.
Declaration
public virtual WorkbookImpl CreateWorkbook(object parent, ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new workbook. |
ExcelVersion | version | Excel version. |
Returns
Type | Description |
---|---|
WorkbookImpl | Newly created workbook. |
CreateWorkbook(Object, Int32, ExcelVersion)
Creates a new Workbook.
Declaration
public virtual WorkbookImpl CreateWorkbook(object parent, int sheetsQuantity, ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new workbook. |
System.Int32 | sheetsQuantity | Number of sheets in the new workbook. |
ExcelVersion | version | Excel version. |
Returns
Type | Description |
---|---|
WorkbookImpl | Newly created workbook. |
CreateWorkbook(Object, Stream, ExcelParseOptions, ExcelVersion)
Creates a new Workbook.
Declaration
public virtual WorkbookImpl CreateWorkbook(object parent, Stream stream, ExcelParseOptions options, ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new workbook. |
System.IO.Stream | stream | Stream with workbook's data. |
ExcelParseOptions | options | Parse options. |
ExcelVersion | version | Excel version. |
Returns
Type | Description |
---|---|
WorkbookImpl | Newly created workbook. |
CreateWorkbook(Object, Stream, ExcelParseOptions, Boolean, String, ExcelVersion)
Creates the workbook.
Declaration
public virtual WorkbookImpl CreateWorkbook(object parent, Stream stream, ExcelParseOptions options, bool bReadOnly, string password, ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new workbook. |
System.IO.Stream | stream | Stream with workbook's data. |
ExcelParseOptions | options | Parse options. |
System.Boolean | bReadOnly | Indicates whether to open workbook in read-only mode. |
System.String | password | Password to decrypt. |
ExcelVersion | version | Excel version. |
Returns
Type | Description |
---|---|
WorkbookImpl | Newly created workbook. |
CreateWorkbook(Object, Stream, ExcelVersion, ExcelParseOptions)
Creates a new Workbook.
Declaration
public virtual WorkbookImpl CreateWorkbook(object parent, Stream stream, ExcelVersion version, ExcelParseOptions options)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new workbook. |
System.IO.Stream | stream | Stream with workbook's data. |
ExcelVersion | version | Excel version. |
ExcelParseOptions | options |
Returns
Type | Description |
---|---|
WorkbookImpl | Newly created workbook. |
CreateWorkbook(Object, Stream, String, Int32, Int32, ExcelVersion, String, Encoding)
Creates a new Workbook.
Declaration
public virtual WorkbookImpl CreateWorkbook(object parent, Stream stream, string separator, int row, int column, ExcelVersion version, string fileName, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new workbook. |
System.IO.Stream | stream | Stream to read. |
System.String | separator | Current separator |
System.Int32 | row | Number of first row to write. |
System.Int32 | column | Number of first column to write. |
ExcelVersion | version | Excel version. |
System.String | fileName | Filename is used to generate worksheet name |
System.Text.Encoding | encoding |
Returns
Type | Description |
---|---|
WorkbookImpl | Created workbook. |
CreateWorkbook(Object, String, ExcelParseOptions, ExcelVersion)
Creates a new Workbook.
Declaration
public virtual WorkbookImpl CreateWorkbook(object parent, string strTemplateFile, ExcelParseOptions options, ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new workbook. |
System.String | strTemplateFile | Name of the file with workbook. |
ExcelParseOptions | options | Parse options. |
ExcelVersion | version | Excel version. |
Returns
Type | Description |
---|---|
WorkbookImpl | Newly created workbook. |
CreateWorkbook(Object, String, ExcelParseOptions, Boolean, String, ExcelVersion)
Creates a new Workbook.
Declaration
public virtual WorkbookImpl CreateWorkbook(object parent, string strTemplateFile, ExcelParseOptions options, bool bReadOnly, string password, ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new workbook. |
System.String | strTemplateFile | Name of the file with workbook. |
ExcelParseOptions | options | Parse options. |
System.Boolean | bReadOnly | Indicates whether to open workbook in read-only mode. |
System.String | password | Password to decrypt. |
ExcelVersion | version | Excel version. |
Returns
Type | Description |
---|---|
WorkbookImpl | Newly created workbook. |
Remarks
This method is supported on Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms only.
CreateWorkbook(Object, String, ExcelVersion)
Creates a new Workbook.
Declaration
public virtual WorkbookImpl CreateWorkbook(object parent, string strTemplateFile, ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new workbook. |
System.String | strTemplateFile | Name of the file with workbook. |
ExcelVersion | version | Excel version. |
Returns
Type | Description |
---|---|
WorkbookImpl | Newly created workbook. |
Remarks
This method is supported on Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms only.
CreateWorksheet(Object)
Creates a new Worksheet.
Declaration
public virtual WorksheetImpl CreateWorksheet(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new worksheet. |
Returns
Type | Description |
---|---|
WorksheetImpl | Newly created worksheet. |
CreateWorksheet(Object, BiffReader, ExcelParseOptions, Boolean, Dictionary<Int32, Int32>, IDecryptor)
Creates a new Worksheet.
Declaration
public virtual WorksheetImpl CreateWorksheet(object parent, BiffReader reader, ExcelParseOptions options, bool bSkipParsing, Dictionary<int, int> hashNewXFormatIndexes, IDecryptor decryptor)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new worksheet. |
BiffReader | reader | Reader with worksheet data. |
ExcelParseOptions | options | Parse options. |
System.Boolean | bSkipParsing | Indicates whether to skip parsing. |
System.Collections.Generic.Dictionary<System.Int32, System.Int32> | hashNewXFormatIndexes | Dictionary with new extended format indexes used in ignore styles mode. |
IDecryptor | decryptor | Object used to decrypt encrypted records. |
Returns
Type | Description |
---|---|
WorksheetImpl | Newly created worksheet. |
DetectFileFromStream(Stream)
Gets file type based on stream data.
Declaration
public ExcelOpenType DetectFileFromStream(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Represents data stream. |
Returns
Type | Description |
---|---|
ExcelOpenType | Returns defined open type (cannot return automatic). |
InchesToPoints(Double)
Converts a measurement from inches to points.
Declaration
public double InchesToPoints(double Inches)
Parameters
Type | Name | Description |
---|---|---|
System.Double | Inches | Value in inches. |
Returns
Type | Description |
---|---|
System.Double | Converted value in points. |
InitializeCollection()
This method initializes inner collections of workbooks.
Declaration
protected void InitializeCollection()
IsExcelFile(Stream)
Checks whether a given stream contains data in Excel format.
Declaration
public bool IsExcelFile(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | File stream that contains workbook. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the file is in excel format else false. |
IsExcelFile(String)
Checks whether a given file is in Excel format based on its file path.
Declaration
public bool IsExcelFile(string FilePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | FilePath | File path that contains workbook. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the file is in excel format else false. |
Remarks
This method is supported on Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms only.
IsSupported(Stream)
Check whether the file version is supported by XlsIO.
Declaration
public bool IsSupported(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | File stream that contains workbook |
Returns
Type |
---|
System.Boolean |
IsSupported(String)
Check whether the file version is supported by XlsIO.
Declaration
public bool IsSupported(string FilePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | FilePath |
Returns
Type |
---|
System.Boolean |
Remarks
This method is supported on Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms only.
MeasureString(String, FontImpl, SizeF)
Measures string.
Declaration
public SizeF MeasureString(string strToMeasure, FontImpl font, SizeF rectSize)
Parameters
Type | Name | Description |
---|---|---|
System.String | strToMeasure | String to measure. |
FontImpl | font | Font to measure. |
System.Drawing.SizeF | rectSize | Rect size. |
Returns
Type | Description |
---|---|
System.Drawing.SizeF | Returns new size. |
RaiseProgressEvent(Int64, Int64)
Raising progress event.
Declaration
public void RaiseProgressEvent(long curPos, long fullSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | curPos | Position. |
System.Int64 | fullSize | Full size. |
remove_OnPasswordRequired(PasswordRequiredEventHandler)
Declaration
public void remove_OnPasswordRequired(PasswordRequiredEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
PasswordRequiredEventHandler | value |
remove_OnWrongPassword(PasswordRequiredEventHandler)
Declaration
public void remove_OnWrongPassword(PasswordRequiredEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
PasswordRequiredEventHandler | value |
remove_ProgressEvent(ProgressEventHandler)
Declaration
public void remove_ProgressEvent(ProgressEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ProgressEventHandler | value |
remove_SubstituteFont(SubstituteFontEventHandler)
Declaration
public void remove_SubstituteFont(SubstituteFontEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SubstituteFontEventHandler | value |
remove_TypeMismatchOnExport(ExportEventHandler)
Declaration
public void remove_TypeMismatchOnExport(ExportEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ExportEventHandler | value |
Save(String)
Saves changes to the active workbook.
Declaration
public void Save(string Filename)
Parameters
Type | Name | Description |
---|---|---|
System.String | Filename | File name of result file. |
Remarks
This method is supported on Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms only.
SetActiveCell(IRange)
Sets active cell.
Declaration
public void SetActiveCell(IRange cell)
Parameters
Type | Name | Description |
---|---|---|
IRange | cell | Range that becomes active. |
SetActiveWorkbook(IWorkbook)
Sets active workbook.
Declaration
public void SetActiveWorkbook(IWorkbook book)
Parameters
Type | Name | Description |
---|---|---|
IWorkbook | book | Workbook that becomes active. |
SetActiveWorksheet(WorksheetBaseImpl)
Sets active worksheet.
Declaration
public void SetActiveWorksheet(WorksheetBaseImpl sheet)
Parameters
Type | Name | Description |
---|---|---|
WorksheetBaseImpl | sheet | Worksheet that becomes active. |
Events
OnPasswordRequired
This event is fired when user tries to open password protected workbook without specifying password. It is used to obtain password.
Declaration
public event PasswordRequiredEventHandler OnPasswordRequired
Event Type
Type |
---|
PasswordRequiredEventHandler |
OnWrongPassword
This event is fired when user specified wrong password when trying to open password protected workbook. It is used to obtain correct password.
Declaration
public event PasswordRequiredEventHandler OnWrongPassword
Event Type
Type |
---|
PasswordRequiredEventHandler |
ProgressEvent
Progress event handler.
Declaration
public event ProgressEventHandler ProgressEvent
Event Type
Type |
---|
ProgressEventHandler |
SubstituteFont
This event is fired to substitute an alternate font when a specified font is not installed in the production environment in Excel to PDF/Image conversion.
Declaration
public event SubstituteFontEventHandler SubstituteFont
Event Type
Type |
---|
SubstituteFontEventHandler |
Remarks
This event is supported for Excel to PDF/Image conversion.
Examples
using(ExcelEngine engine = new ExcelEngine())
{
IApplication application = engine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
//Initializes the SubstituteFont event to perform font substitution during ExceltoPDFconversion.
application.SubstituteFont += new SubstituteFontEventHandler(SubstituteFont);
IWorksheet worksheet = workbook.Worksheets[0];
ExcelToPdfConverter converter = new ExcelToPdfConverter(workbook);
PdfDocument doc = new PdfDocument();
doc = converter.Convert();
doc.Save("PDF.pdf");
workbook.SaveAs("output.xlsx");
}
void SubstituteFont(object sender, SubstituteFontEventArgs args)
{
// Sets the alternate font when a specified font is not installed in the production environment.
if (args.OriginalFontName == "Wingdings Regular")
args.AlternateFontName = "Bauhaus 93";
else
args.AlternateFontName = "Times New Roman";
}
TypeMismatchOnExport
Declaration
public event ExportEventHandler TypeMismatchOnExport
Event Type
Type |
---|
ExportEventHandler |