Created
September 23, 2012 22:14
-
-
Save derans/3773231 to your computer and use it in GitHub Desktop.
Specific Columns & Formatting with Helper Method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ActionResult ExportToExcel() | |
{ | |
var records = _getSampleInfoQuery.Execute(); | |
var columns = new[] | |
{ | |
Column(x => x.College), | |
Column(x => x.Amount, ExcelFormat.Money), | |
Column(x => x.CreatedDate, ExcelFormat.Date, "Date"), | |
Column(x => x.CreatedBy), | |
Column(x => x.CreatedDate, ExcelFormat.Time, "Time"), | |
Column(x => x.PercentageExample, ExcelFormat.Percent), | |
}; | |
return new ExcelFileResult<SampleInfo>(records) {ColumnDefinitions = columns}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment