메소드 | 설명 | |
---|---|---|
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 |
리턴 |