Метод | Описание | |
---|---|---|
AddWorksheet ( this excel, |
Adds a worksheet from a DataTable
|
|
CreateNewFile ( |
Creates an Excel Workbook from a DataSet
|
|
DefaultColumnFormat ( IRockGridField field, object exportValue ) : string |
Sets the default formatting for an excel column based on the field type and data type
|
|
DefaultColumnFormat ( |
Sets the default formatting for an excel column based on the data type
|
|
FinalColumnFormat ( object exportValue, string defaultFormat ) : string |
Updates the excel column format based on the level of detail in the data
|
|
FormatWorksheet ( this worksheet, string title, int headerRows, int rows, int columns ) : void |
Apply the default Rock worksheet formatting
|
|
Save ( |
Saves an ExcelPackage as a BinaryFile and stores it in the database
|
|
SendToBrowser ( this excel, System page, string filename ) : void |
Sends an Excel workbook to the user
|
|
SetExcelValue ( OfficeOpenXml.ExcelRange range, object exportValue ) : void |
Formats the export value.
|
|
ToByteArray ( this excel ) : byte[] |
Convert an ExcelPackage to a ByteArray
|
|
ToMemoryStream ( this excel ) : |
Convert an ExcelPackage to a MemoryStream
|
public static AddWorksheet ( this excel, |
||
excel | this | The ExcelPackage object to add a worksheet to |
data | The DataTable to populate the worksheet with. The TableName of the DataTable will be the header and Tab name of the worksheet. | |
Результат | void |
public static CreateNewFile ( |
||
sqlResults | The DataSet to populate a workbook with. The TableName of each DataTable will be the header and Tab name of each sheet. | |
title | string | The Title of the workbook |
Результат |
public static DefaultColumnFormat ( IRockGridField field, object exportValue ) : string | ||
field | IRockGridField | The grid field |
exportValue | object | An example value for this column; you can use the data from the first row |
Результат | string |
public static DefaultColumnFormat ( |
||
type | The data type of the column | |
Результат | string |
public static FinalColumnFormat ( object exportValue, string defaultFormat ) : string | ||
exportValue | object | The cell value to use for formatting |
defaultFormat | string | The existing column format to use if no changes are to be made |
Результат | string |
public static FormatWorksheet ( this worksheet, string title, int headerRows, int rows, int columns ) : void | ||
worksheet | this | The worksheet to be formatted |
title | string | The title to display in the worksheet header |
headerRows | int | The number of rows to use for the header |
rows | int | The number of rows populated in the worksheet |
columns | int | The number of columns populated in the worksheet |
Результат | void |
public static Save ( |
||
excel | The ExcelPackage object to save | |
fileName | string | The filename to save the workbook as |
rockContext | The RockContext to use | |
binaryFileType | BinaryFileType | Optionally specifies the BinaryFileType to apply to this file for security purposes |
Результат | BinaryFile |
public static SendToBrowser ( this excel, System page, string filename ) : void | ||
excel | this | The ExcelPackage to send |
page | System | The current Page object |
filename | string | The filename to send the file as |
Результат | void |
public static SetExcelValue ( OfficeOpenXml.ExcelRange range, object exportValue ) : void | ||
range | OfficeOpenXml.ExcelRange | The range. |
exportValue | object | The export value. |
Результат | void |
public static ToByteArray ( this excel ) : byte[] | ||
excel | this | The ExcelPackage |
Результат | byte[] |
public static ToMemoryStream ( this excel ) : |
||
excel | this | The ExcelPackage |
Результат |