Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void ExportToExcell(ExcelExporter.Output mode)
- {
- var exporter = new ExcelExporter("List: LineItem Volume Report");
- // Add header texts:
- exporter.AddColumn("Submitted date", "DateTime");
- exporter.AddColumn("Account Name");
- exporter.AddColumn("Contact");
- exporter.AddColumn("Search type");
- exporter.AddColumn("Search Status");
- exporter.AddColumn("Address");
- this.AddSearchFilters();
- // Add data rows:
- foreach (var Item in this.GetDataSource())
- {
- exporter.AddRow(
- "{0:dd/MM/yy}".FormatWith(Item.Order.SubmittedDate),
- Item.Order.Contact.Account.Name,
- Item.Order.Contact,
- Item.Product,
- Item.Status,
- Item.Order.Address.FullAddress);
- }
- Response.Dispatch(exporter.Generate(mode), "{0}-{1}".FormatWith(LocalTime.Now,VolumeReport.GetReportType()) + exporter.GetFileExtension(mode), "application/vnd.ms-excel", true, System.Text.Encoding.UTF8);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement