Example #1
0
        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
            }
        }
Example #2
0
        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)));
        }