Exemplo n.º 1
0
        void exporter_ExcelTableCreated(object sender, Telerik.WinControls.UI.Export.ExcelML.ExcelTableCreatedEventArgs e)
        {
            string             headerText = "Custom added header text.";
            SingleStyleElement style      = ((ExportToExcelML)sender).AddCustomExcelRow(e.ExcelTableElement, 50, headerText);

            style.FontStyle.Bold        = true;
            style.FontStyle.Size        = 18;
            style.FontStyle.Color       = Color.White;
            style.InteriorStyle.Color   = Color.Red;
            style.InteriorStyle.Pattern = InteriorPatternType.Solid;
            style.AlignmentElement.HorizontalAlignment = HorizontalAlignmentType.Center;
            style.AlignmentElement.VerticalAlignment   = VerticalAlignmentType.Center;
        }
        void export_ExcelTableCreated(object sender, Telerik.WinControls.UI.Export.ExcelML.ExcelTableCreatedEventArgs e)
        {
            if (this.Heading.ToStr().Trim().Length > 0)
            {
                // string headerText = "Data Range : " + string.Format("{0:dd-MMM-yy}", dtpFromDate2.Value) + " to " + string.Format("{0:dd-MMM-yy}", dtpToDate2.Value);
                SingleStyleElement style = ((ExportToExcelML)sender).AddCustomExcelRow(e.ExcelTableElement, 30, this.Heading);
                style.FontStyle.Bold = true;

                if (ApplyCustomCellFormatting)
                {
                    this.TitleFontSize = 12;
                }

                style.FontStyle.Size        = this.TitleFontSize;  //18;
                style.FontStyle.Color       = this.TitleForeColor; //Color.White;
                style.InteriorStyle.Color   = this.TitleBackColor; //Color.Red;
                style.InteriorStyle.Pattern = InteriorPatternType.Solid;
                style.AlignmentElement.HorizontalAlignment = HorizontalAlignmentType.Center;
                style.AlignmentElement.VerticalAlignment   = VerticalAlignmentType.Center;
            }
        }