¶
PDFExportOptions¶
Properties¶
| Name | Data Type | Static | Readonly | Description |
|---|---|---|---|---|
| IsLandscape | bool | No | No | |
| PageSize | string | No | No | A0, A1, A2, A3, A4 etc |
| PageScaleFactor | float | No | No | Accepts values between 0 and 1. Default 0.9 |
| PageMarginRight | double | No | No | The right margin of the page |
| PageMarginBottom | double | No | No | The bottom margin of the page |
| Password | string | No | No | If set, generated PDF will require this password to open |
ExcelVerticalAlignment¶
Description¶
Enumeration holding all the available Excel Align Types.
Properties¶
| Name | Data Type | Static | Readonly | Description |
|---|---|---|---|---|
| Bottom | int | No | No | |
| Center | int | No | No | |
| Distributed | int | No | No | |
| Justify | int | No | No | |
| Top | int | No | No |
ExcelBorderType¶
Description¶
Enumeration holding all the available Excel Border Types.
Properties¶
| Name | Data Type | Static | Readonly | Description |
|---|---|---|---|---|
| Thin | int | No | No | |
| Thick | int | No | No | |
| None | int | No | No |
ExcelHorizontalAlignment¶
Description¶
Enumeration holding all the available Excel Align Types.
Properties¶
| Name | Data Type | Static | Readonly | Description |
|---|---|---|---|---|
| General | int | No | No | |
| Left | int | No | No | |
| Center | int | No | No | |
| CenterContinuous | int | No | No | |
| Right | int | No | No | |
| Fill | int | No | No | |
| Distributed | int | No | No | |
| Justify | int | No | No |
ExcelBorderStyle¶
Properties¶
| Name | Data Type | Static | Readonly | Description |
|---|---|---|---|---|
| Color | string | No | No | |
| Type | ExcelLib.ExcelBorderType | No | No |
ExcelStyle¶
Properties¶
| Name | Data Type | Static | Readonly | Description |
|---|---|---|---|---|
| Bold | bool | No | No | |
| Italic | bool | No | No | |
| Merge | bool | No | No | |
| WrapText | bool | No | No | |
| FontColor | string | No | No | |
| FontName | string | No | No | |
| FontSize | double | No | No | |
| BackgroundColor | string | No | No | |
| BorderTop | ExcelLib.ExcelBorderStyle | No | No | |
| BorderLeft | ExcelLib.ExcelBorderStyle | No | No | |
| BorderRight | ExcelLib.ExcelBorderStyle | No | No | |
| BorderBottom | ExcelLib.ExcelBorderStyle | No | No | |
| HorizontalAlignment | ExcelLib.ExcelHorizontalAlignment | No | No | |
| VerticalAlignment | ExcelLib.ExcelVerticalAlignment | No | No |
Methods¶
Create()¶
Description
Return Type : ExcelLib.ExcelStyle
Static : Yes
Namespace : ExcelLib.ExcelStyle
ExcelPackage¶
ExcelHelper¶
Methods¶
Create(ExcelLib.ExcelPackage)¶
Description
Return Type : ExcelLib.ExcelHelper
Static : Yes
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| excelPackage | ExcelLib.ExcelPackage |
CreateEmpty()¶
Description
Return Type : ExcelLib.ExcelHelper
Static : Yes
Namespace : ExcelLib.ExcelHelper
Syntax
var excel = ExcelLib.ExcelHelper.CreateEmpty();
LoadFromFile(string)¶
Description
Return Type : ExcelLib.ExcelHelper
Static : Yes
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| path | string | Full Excel file path |
Syntax
var excel = ExcelLib.ExcelHelper.LoadFromFile(path);
ExportToPDF(Array[byte])¶
Description
Return Type : Array
Static : Yes
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| excel | Array |
Syntax
var pdfData = ExcelLib.ExcelHelper.ExportToPDF(path);
ExportToPDF(Array[byte], ExcelLib.PDFExportOptions)¶
Description
Return Type : Array
Static : Yes
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| excel | Array | |
| options | ExcelLib.PDFExportOptions |
Syntax
var pdfData = ExcelLib.ExcelHelper.ExportToPDF(path);
SetPassword(string)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| password | string |
Syntax
excel.SetPassword("Password");
SetAuthor(string)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| author | string |
Syntax
excel.SetAuthor("Author Name");
GetAuthor()¶
Description
Return Type : string
Static : No
Namespace : ExcelLib.ExcelHelper
Syntax
var author = excel.GetAuthor();
AddSheet(string)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| name | string |
Syntax
excel.AddSheet("New Sheet");
RenameSheet(int, string)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheetIndex | int | |
| name | string |
Syntax
excel.RenameSheet(sheetIndex, "New Sheet Name");
RemoveSheet(int)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheetIndex | int |
Syntax
excel.RemoveSheet(sheetIndex);
SetColumnWidth(int, int, int)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheetIndex | int | Index of the sheet (1 based) |
| column | int | Index of the column (1 based) |
| numberOfCharactersToFit | int | Number of characters to fit |
Syntax
excel.SetColumnWidth(1, 2, 100); // will try to set the width of column 2 to fit 100 characters
ReadFromCell(int, int, int)¶
Description
Return Type : Object
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | Index of the sheet (1 based) |
| row | int | Index of the row (1 based) |
| column | int | Index of the column (1 based) |
Syntax
excel.ReadFromCell(1, 42, 8);
ReadFromCell(string, int, int)¶
Description
Return Type : Object
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | string | Sheet name |
| row | int | Index of the row (1 based) |
| column | int | Index of the column (1 based) |
Syntax
excel.ReadFromCell("Sheet 1", 42, 8);
ReadFromCellAsString(int, int, int)¶
Description
Return Type : string
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | Index of the sheet (1 based) |
| row | int | Index of the row (1 based) |
| column | int | Index of the column (1 based) |
Syntax
excel.ReadFromCellAsString(1, 42, 8);
ReadFromCellAsString(string, int, int)¶
Description
Return Type : string
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | string | Sheet name |
| row | int | Index of the row (1 based) |
| column | int | Index of the column (1 based) |
Syntax
excel.ReadFromCellAsString("Sheet 1", 42, 8);
StyleCell(int, int, int, ExcelLib.ExcelStyle)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | Index of the sheet (1 based) |
| row | int | Index of the row (1 based) |
| column | int | Index of the column (1 based) |
| style | ExcelLib.ExcelStyle | Style to apply to the cell |
Syntax
excel.StyleCell(1, 42, 8, style);
StyleCells(int, int, int, int, int, ExcelLib.ExcelStyle)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | Index of the sheet (1 based) |
| rowStart | int | Index of the starting row (1 based) |
| rowEnd | int | Index of the ending row (1 based) |
| columnStart | int | Index of the starting column (1 based) |
| columnEnd | int | Index of the ending column (1 based) |
| style | ExcelLib.ExcelStyle | Style to apply to the cell |
Syntax
excel.StyleCells(1, 42, 8, 45, 10, style);
WriteToCell(int, int, int, Object)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | Index of the sheet (1 based) |
| row | int | Index of the row (1 based) |
| column | int | Index of the column (1 based) |
| value | Object | Value to write to the cell |
Syntax
excel.WriteToCell(1, 42, 8, 20.25);
WriteToCell(int, int, int, Object, ExcelLib.ExcelStyle)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | Index of the sheet (1 based) |
| row | int | Index of the row (1 based) |
| column | int | Index of the column (1 based) |
| value | Object | Value to write to the cell |
| style | ExcelLib.ExcelStyle | Style to apply to the cell |
Syntax
excel.WriteToCell(1, 42, 8, 20.25, style);
WriteToCell(string, int, int, Object)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | string | Sheet name |
| row | int | Index of the row (1 based) |
| column | int | Index of the column (1 based) |
| value | Object | Value to write to the cell |
Syntax
excel.WriteToCell("Sheet 1", 42, 8, 20.25);
WriteToCell(string, int, int, Object, string, string)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | string | Sheet name |
| row | int | Index of the row (1 based) |
| column | int | Index of the column (1 based) |
| value | Object | Value to write to the cell |
| format | string | Format |
| excelFormat | string | Excel Format |
Syntax
excel.WriteToCell("Sheet 1", 42, 8, 20.25, "#,0.0000;'-'#,0.0000;'0'", "#,##0.0000;-#,##0.0000;#,##0.0000");
WriteToCell(int, int, int, Object, string, string, ExcelLib.ExcelStyle)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | Index of the sheet (1 based) |
| row | int | Index of the row (1 based) |
| column | int | Index of the column (1 based) |
| value | Object | Value to write to the cell |
| format | string | Format |
| excelFormat | string | Excel Format |
| style | ExcelLib.ExcelStyle | Style to apply to the cell |
Syntax
excel.WriteToCell(1, 42, 8, 20.25, "#,0.0000;'-'#,0.0000;'0'", "#,##0.0000;-#,##0.0000;#,##0.0000", style);
WriteToCell(int, int, int, Object, string, string)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | Index of the sheet (1 based) |
| row | int | Index of the row (1 based) |
| column | int | Index of the column (1 based) |
| value | Object | Value to write to the cell |
| format | string | Format |
| excelFormat | string | Excel Format |
Syntax
excel.WriteToCell(1, 42, 8, 20.25, "#,0.0000;'-'#,0.0000;'0'", "#,##0.0000;-#,##0.0000;#,##0.0000");
AutoFitColumns(string)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | string | Sheet name |
Syntax
excel.AutoFitColumns("Sheet 1");
WriteFormulaToCell(int, int, int, string, ExcelLib.ExcelStyle)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | Index of the sheet (1 based) |
| row | int | Index of the row (1 based) |
| column | int | Index of the column (1 based) |
| formula | string | Formula to write to the cell |
| style | ExcelLib.ExcelStyle | Style to apply to the cell |
Syntax
excel.WriteFormulaToCell(1, 8, 2, "=SUM(B1:B7)", style);
WriteFormulaToCell(int, int, int, string)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | Index of the sheet (1 based) |
| row | int | Index of the row (1 based) |
| column | int | Index of the column (1 based) |
| formula | string | Formula to write to the cell |
Syntax
excel.WriteFormulaToCell(1, 8, 2, "=SUM(B1:B7)");
WriteFormulaToCell(string, int, int, string)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | string | Sheet name |
| row | int | Index of the row (1 based) |
| column | int | Index of the column (1 based) |
| formula | string | Formula to write to the cell |
Syntax
excel.WriteFormulaToCell("Sheet 1", 8, 2, "=SUM(B1:B7)");
GetAsByteArray()¶
Description
Return Type : Array
Static : No
Namespace : ExcelLib.ExcelHelper
Syntax
excel.GetAsByteArray();
Save(string)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| path | string | Full file path |
Syntax
excel.Save(filePath);
AddRowOnTop(string)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| text | string |
AddRowOnTop(string, ExcelLib.ExcelStyle)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| text | string | |
| style | ExcelLib.ExcelStyle |
AddRowAtBottom(string)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| text | string |
AddRowAtBottom(string, ExcelLib.ExcelStyle)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| text | string | |
| style | ExcelLib.ExcelStyle |
AddRowsAtPosition(int, int, int)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | |
| startingFromRow | int | |
| noOfRowsToCreate | int |
AddRowsAtPosition(int, int, int, int)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | |
| startingFromRow | int | |
| noOfRowsToCreate | int | |
| copyStyleFromRow | int |
DeleteRows(int, int, int)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | |
| startingFromRow | int | |
| noOfRowsToDelete | int |
AddPicture(int, int, int, string)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | |
| row | int | |
| column | int | |
| path | string |
AddPicture(int, int, int, string, int, int)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | |
| row | int | |
| column | int | |
| path | string | |
| width | int | |
| height | int |
AddPicture(int, int, int, Array[byte])¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | |
| row | int | |
| column | int | |
| fileData | Array |
AddPicture(int, int, int, Array[byte], int, int)¶
Description
Return Type : void
Static : No
Namespace : ExcelLib.ExcelHelper
Parameters
| Name | Data Type | Description |
|---|---|---|
| sheet | int | |
| row | int | |
| column | int | |
| fileData | Array | |
| width | int | |
| height | int |