public override void Export() { OverdueChargesReport report = ViewState["OverdueChargesReport"] as OverdueChargesReport; if (report != null) { var document = new ExcelDocument(); document.WriteTitle(report.Title); if (this.CurrentScope() == Scope.AllClientsScope) { reportGridView.Columns[0].Visible = false; //remove the client number from report reportGridView.Columns[2].Visible = false; //remove the customer number from report } else if (this.CurrentScope() == Scope.ClientScope) { reportGridView.Columns[0].Visible = false; //remove the customer number from report } reportGridView.WriteToExcelDocument(document); document.MoveToNextRow(); document.MoveToNextRow(); document.AddCell("Date Viewed"); document.AddCell(report.DateViewed.ToDateTimeString()); WriteToResponse(document.WriteToStream(), report.ExportFileName); } }
public override void Export() { var report = ViewState["TransactionReport"] as TransactionReport; if (report != null) { ExcelDocument document = new ExcelDocument(); document.WriteTitle(report.Title); ReportGridView.Columns[0].Visible = false; //do not display in report ReportGridView.WriteToExcelDocument(document); document.InsertEmptyRow(); document.MoveToNextRow(); document.AddCell("Funded Total"); document.AddCurrencyCell(report.FundedTotal); document.MoveToNextRow(); document.AddCell("Non Funded Total"); document.AddCurrencyCell(report.NonFundedTotal); document.InsertEmptyRow(); document.AddCell("Date Viewed"); document.AddCell(report.DateViewed.ToDateTimeString()); WriteToResponse(document.WriteToStream(), report.ExportFileName); } }
public override void Export() { var report = ViewState["CustomerTransactionReport"] as CustomerTransactionReport; if (report != null) { var document = new ExcelDocument(); document.WriteTitle(report.Title); ReportGridView.WriteToExcelDocument(document); document.InsertEmptyRow(); document.AddCell("Date Viewed"); document.AddCell(report.DateViewed.ToDateTimeString()); WriteToResponse(document.WriteToStream(), report.ExportFileName); } }
public override void Export() { AgedBalancesReport report = ViewState["AgedBalancesReport"] as AgedBalancesReport; System.Collections.Generic.IList <AgedBalancesReportRecord> exportRecordWithNotes = new System.Collections.Generic.List <AgedBalancesReportRecord>(); foreach (AgedBalancesReportRecord rptRecord in report.Records) { System.Collections.Generic.IList <CustomerNote> cnList = rptRecord.CustNoteList; rptRecord.Note = ""; foreach (CustomerNote cNote in cnList) { if (!string.IsNullOrEmpty(cNote.Comment)) { rptRecord.Note += "[" + cNote.CreatedByEmployeeName + "][" + cNote.Created.ToShortDateString() + "]"; rptRecord.Note += cNote.Comment + System.Environment.NewLine; } } if (!string.IsNullOrEmpty(rptRecord.Note)) { rptRecord.CustNoteList.Clear(); } exportRecordWithNotes.Add(rptRecord); } //init columns CffGenGridView exportGrid = this.reportGridView; if (this.isReportWithNotes) { exportGrid.AllowSorting = true; exportGrid.SetSortExpression = "CustomerName"; exportGrid.InsertDataColumn("Customer", "CustomerName"); exportGrid.InsertCurrencyColumn("Current", "CurrentBalance"); exportGrid.InsertCurrencyColumn("Month 1", "MonthOldBalance"); exportGrid.InsertCurrencyColumn("Month 2", "TwoMonthsOldBalance"); exportGrid.InsertCurrencyColumn("Month 3+", "ThreeMonthsOrOlderBalance"); exportGrid.InsertCurrencyColumn("Balance", "Balance"); exportGrid.InsertDataColumn("Next Call", "NextCallDate", CffGridViewColumnType.Date, "10%", "cffGGV_centerAlignedCell", HorizontalAlign.Center, HorizontalAlign.Center, true); exportGrid.InsertDataColumn("Note", "Note"); exportGrid.Visible = false; exportGrid.InsertDataColumn("Email", "Email"); exportGrid.InsertDataColumn("Contact", "Contact"); exportGrid.InsertDataColumn("Phone", "Phone"); exportGrid.InsertDataColumn("Mobile Phone", "Cell"); exportGrid.TotalsSummarySettings.SetColumnTotals("CurrentBalance, MonthOldBalance, TwoMonthsOldBalance, ThreeMonthsOrOlderBalance, Balance"); exportGrid.CustomFooterSettings = CffCustomFooterMode.ShowTotals | CffCustomFooterMode.DefaultSettings; exportGrid.DataSource = exportRecordWithNotes; exportGrid.DataBind(); } if (report != null) { ExcelDocument document = new ExcelDocument(); document._HSFFGetSheet.SetColumnWidth(8, 400); document.WriteTitle(report.Title); if (IsReportWithNotesLiteral.Text.ToLower() == "true") { exportGrid.WriteToExcelDocument(document); } else { reportGridView.WriteToExcelDocument(document); } document.MoveToNextRow(); document.MoveToNextRow(); document.AddCell("Date Viewed"); document.AddCell(report.DateViewed.ToDateTimeString()); WriteToResponse(document.WriteToStream(), report.ExportFileName); } }