void options_CustomizeSheetHeader(DevExpress.Export.ContextEventArgs e) { // Create a new row. CellObject row = new CellObject(); XlFormattingObject rowFormatting = new XlFormattingObject(); // Specify row values. row.Value = "CORTE ALQUILER"; rowFormatting.Font = new XlCellFont { Bold = true, Size = 14 }; rowFormatting.BackColor = Color.Orange; rowFormatting.Alignment = new DevExpress.Export.Xl.XlCellAlignment { HorizontalAlignment = DevExpress.Export.Xl.XlHorizontalAlignment.Center, VerticalAlignment = DevExpress.Export.Xl.XlVerticalAlignment.Top }; row.Formatting = rowFormatting; // Add the created row to the output document. e.ExportContext.AddRow(new[] { row }); // Add an empty row to the output document. e.ExportContext.AddRow(); // Merge cells of two new rows. if (idArea == idAreaComercialSupervisor) { e.ExportContext.MergeCells(new DevExpress.Export.Xl.XlCellRange(new DevExpress.Export.Xl.XlCellPosition(0, 0), new DevExpress.Export.Xl.XlCellPosition(9, 1))); //EL 6 SON LAS COLUMNAS QUE TIENE EL REPORTE } else { e.ExportContext.MergeCells(new DevExpress.Export.Xl.XlCellRange(new DevExpress.Export.Xl.XlCellPosition(0, 0), new DevExpress.Export.Xl.XlCellPosition(8, 1))); //EL 6 SON LAS COLUMNAS QUE TIENE EL REPORTE } }
static void AddAddressLocationCityRow(ContextEventArgs e, XlFormattingObject formatFirstCell, XlFormattingObject formatSecondCell) { var AddressLocationCityCell = CreateCell("Los Angeles CA 90731 USA", formatSecondCell); e.ExportContext.AddRow(new[] { null, null, AddressLocationCityCell }); }
static void AddAddressRow(ContextEventArgs e, XlFormattingObject formatFirstCell, XlFormattingObject formatSecondCell) { var AddressCellName = CreateCell("Address: ", formatFirstCell); var AddresssCellLocation = CreateCell("807 West Paseo Del Mar", formatSecondCell); e.ExportContext.AddRow(new[] { AddressCellName, null, AddresssCellLocation }); }
static void AddPhoneRow(ContextEventArgs e, XlFormattingObject formatFirstCell, XlFormattingObject formatSecondCell) { var phoneCellName = CreateCell("Phone :", formatFirstCell); var phoneCellLocation = CreateCell("+ 1 (213) 555-2828", formatSecondCell); e.ExportContext.AddRow(new[] { phoneCellName, null, phoneCellLocation }); }
static void AddFaxRow(ContextEventArgs e, XlFormattingObject formatFirstCell, XlFormattingObject formatSecondCell) { var faxCellName = CreateCell("Fax :", formatFirstCell); var faxCellLocation = CreateCell("+ 1 (213) 555-1824", formatSecondCell); e.ExportContext.AddRow(new[] { faxCellName, null, faxCellLocation }); }
static void AddEmailRow(ContextEventArgs e, XlFormattingObject formatFirstCell, XlFormattingObject formatSecondCell) { var emailCellName = CreateCell("Email :", formatFirstCell); var emailCellLocation = CreateCell("*****@*****.**", formatSecondCell); emailCellLocation.Hyperlink = "*****@*****.**"; e.ExportContext.AddRow(new[] { emailCellName, null, emailCellLocation }); }
// Specify a cell's alignment and font settings. static XlFormattingObject CreateXlFormattingObject(bool bold, double size) { var cellFormat = new XlFormattingObject { Font = new XlCellFont { Bold = bold, Size = size }, Alignment = new XlCellAlignment { RelativeIndent = 10, HorizontalAlignment = XlHorizontalAlignment.Center, VerticalAlignment = XlVerticalAlignment.Center } }; return(cellFormat); }
void options_CustomizeSheetHeader(DevExpress.Export.ContextEventArgs e) { // Create a new row. CellObject row = new CellObject(); XlFormattingObject rowFormatting = new XlFormattingObject(); // Specify row values. row.Value = "FACTURAS POR VENCER"; rowFormatting.Font = new XlCellFont { Bold = true, Size = 14 }; rowFormatting.BackColor = Color.Orange; rowFormatting.Alignment = new DevExpress.Export.Xl.XlCellAlignment { HorizontalAlignment = DevExpress.Export.Xl.XlHorizontalAlignment.Center, VerticalAlignment = DevExpress.Export.Xl.XlVerticalAlignment.Top }; row.Formatting = rowFormatting; // Add the created row to the output document. e.ExportContext.AddRow(new[] { row }); // Add an empty row to the output document. e.ExportContext.AddRow(); // Merge cells of two new rows. e.ExportContext.MergeCells(new DevExpress.Export.Xl.XlCellRange(new DevExpress.Export.Xl.XlCellPosition(0, 0), new DevExpress.Export.Xl.XlCellPosition(11, 1))); }
private void options_CustomizeSheetHeader(ContextEventArgs e) { // Create a new row. CellObject row = new CellObject(); // Specify row values. row.Value = "RM" + informacoesDTO.Id.ToString("00000") + " - P" + informacoesDTO.Negocio_Id.ToString("0000") + " - DESCRIÇÃO: " + informacoesDTO.Descricao.ToUpper(); // Specify row formatting. XlFormattingObject rowFormatting = new XlFormattingObject(); rowFormatting.Font = new XlCellFont { Bold = true, Size = 14 }; rowFormatting.Alignment = new DevExpress.Export.Xl.XlCellAlignment { HorizontalAlignment = DevExpress.Export.Xl.XlHorizontalAlignment.Center, VerticalAlignment = DevExpress.Export.Xl.XlVerticalAlignment.Top }; row.Formatting = rowFormatting; // Add the created row to the output document. e.ExportContext.AddRow(new[] { row }); // Add an empty row to the output document. e.ExportContext.AddRow(); // Merge cells of two new rows. e.ExportContext.MergeCells(new DevExpress.Export.Xl.XlCellRange(new DevExpress.Export.Xl.XlCellPosition(0, 0), new DevExpress.Export.Xl.XlCellPosition(7, 1))); }
// Create a new cell with a specified value and format settings. static CellObject CreateCell(object value, XlFormattingObject formatCell) { return(new CellObject { Value = value, Formatting = formatCell }); }