Ejemplo n.º 1
0
        private ExportCacheCellStyle GetHeaderStyle()
        {
            ExportCacheCellStyle style = new ExportCacheCellStyle();

            style.BottomBorder = new ExportCacheCellBorderStyle()
            {
                Color_ = Color.Black, Width = 1
            };
            style.LeftBorder = new ExportCacheCellBorderStyle()
            {
                Color_ = Color.Black, Width = 1
            };
            style.RightBorder = new ExportCacheCellBorderStyle()
            {
                Color_ = Color.Black, Width = 1
            };
            style.TopBorder = new ExportCacheCellBorderStyle()
            {
                Color_ = Color.Black, Width = 1
            };
            style.TextFont    = new Font("Arial", 10, FontStyle.Bold);
            style.BkColor     = Color.FromArgb(153, 204, 255);
            style.BrushStyle_ = BrushStyle.Solid;
            return(style);
        }
        public ExportCacheCellStyle GetColumnHeaderStyle()
        {
            ExportCacheCellStyle cellStyle = DefaultCellStyle;

            cellStyle.BkColor       = Color.FromArgb(245, 240, 220);
            cellStyle.TextAlignment = StringAlignment.Near;
            ExportCacheCellBorderStyle borderStyle = new ExportCacheCellBorderStyle();

            borderStyle.Color_     = Color.FromArgb(220, 210, 205);
            borderStyle.Width      = 2;
            cellStyle.BottomBorder = cellStyle.LeftBorder = cellStyle.RightBorder = borderStyle;
            return(cellStyle);
        }
        public ExportCacheCellStyle GetBandHeaderStyle()
        {
            ExportCacheCellStyle cellStyle = DefaultCellStyle;

            cellStyle.BkColor       = Color.FromArgb(236, 233, 216);
            cellStyle.TextAlignment = StringAlignment.Center;
            ExportCacheCellBorderStyle borderStyle = new ExportCacheCellBorderStyle();

            borderStyle.Color_  = Color.FromArgb(212, 208, 200);
            borderStyle.Width   = 3;
            cellStyle.TopBorder = cellStyle.BottomBorder = cellStyle.LeftBorder = cellStyle.RightBorder = borderStyle;
            return(cellStyle);
        }
        public XtraGridExcelExporterBase(string fileName, GridView pGridView)
        {
            _xlsProvider = new DevExpress.XtraExport.ExportXlsProvider(fileName);
            _gridView    = pGridView;

            ExportCacheCellStyle cellStyle = _xlsProvider.GetDefaultStyle();

            cellStyle.BkColor       = Color.White;
            cellStyle.TextAlignment = StringAlignment.Near;
            ExportCacheCellBorderStyle borderStyle = new ExportCacheCellBorderStyle();

            borderStyle.Color_  = Color.White;
            borderStyle.Width   = 1;
            cellStyle.TopBorder = cellStyle.BottomBorder = cellStyle.LeftBorder = cellStyle.RightBorder = borderStyle;
            _xlsProvider.SetDefaultStyle(cellStyle);
        }
        public static ExportCacheCellStyle ConvertAppearanceToCellStyle(AppearanceObject ap)
        {
            ExportCacheCellStyle cellStyle = new ExportCacheCellStyle();

            cellStyle.BkColor = ap.BackColor2;
            cellStyle.FgColor = ap.ForeColor;

            switch (ap.TextOptions.HAlignment)
            {
            case HorzAlignment.Far: cellStyle.TextAlignment = StringAlignment.Far; break;

            case HorzAlignment.Near: cellStyle.TextAlignment = StringAlignment.Near; break;

            default: cellStyle.TextAlignment = StringAlignment.Center; break;
            }
            ExportCacheCellBorderStyle borderStyle = new ExportCacheCellBorderStyle();

            borderStyle.Color_  = Color.FromArgb(220, 210, 205);
            borderStyle.Width   = 1;
            cellStyle.TopBorder = cellStyle.BottomBorder = cellStyle.LeftBorder = cellStyle.RightBorder = borderStyle;
            cellStyle.TextFont  = ap.Font;
            return(cellStyle);
        }
Ejemplo n.º 6
0
        private ExportCacheCellStyle GetCellStyle()
        {
            ExportCacheCellStyle style = new ExportCacheCellStyle();

            style.BottomBorder = new ExportCacheCellBorderStyle()
            {
                Color_ = Color.Black, Width = 1
            };
            style.LeftBorder = new ExportCacheCellBorderStyle()
            {
                Color_ = Color.Black, Width = 1
            };
            style.RightBorder = new ExportCacheCellBorderStyle()
            {
                Color_ = Color.Black, Width = 1
            };
            style.TopBorder = new ExportCacheCellBorderStyle()
            {
                Color_ = Color.Black, Width = 1
            };
            style.TextFont = new Font("Arial", 10);
            return(style);
        }
Ejemplo n.º 7
0
        private ExportCacheCellStyle GetFormatCellStyle(string format)
        {
            ExportCacheCellStyle style = new ExportCacheCellStyle();

            style.BottomBorder = new ExportCacheCellBorderStyle()
            {
                Color_ = Color.Black, Width = 1
            };
            style.LeftBorder = new ExportCacheCellBorderStyle()
            {
                Color_ = Color.Black, Width = 1
            };
            style.RightBorder = new ExportCacheCellBorderStyle()
            {
                Color_ = Color.Black, Width = 1
            };
            style.TopBorder = new ExportCacheCellBorderStyle()
            {
                Color_ = Color.Black, Width = 1
            };
            style.TextFont     = new Font("Arial", 9);
            style.FormatString = format;
            return(style);
        }