We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Converting an Excel workbook with angled table headers to an image

Thread ID:





119135 May 13,2015 09:33 PM UTC May 14,2015 09:51 AM UTC WinForms 1
Tags: XlsIO
Kenneth Nelson
Asked On May 13, 2015 09:33 PM UTC

I'm attempting to convert an Excel workbook with angled table headers to an image, but the results are not at all what I was expecting. Here's a simple sample:

            var excelEngine = new ExcelEngine();
            var app = excelEngine.Excel;
            app.DefaultVersion = ExcelVersion.Excel2013;
            var workbook = app.Workbooks.Create(1);
            var worksheet = workbook.Worksheets[0];

            for (int c = 1; c < 13; c++)
                var range = worksheet.Range[2, c];
                range.Text = "Test " + c;
                range.CellStyle.Rotation = 45;
                range.CellStyle.Color = Color.ForestGreen;
                range.CellStyle.Font.RGBColor = Color.Black;

                range.BorderAround(ExcelLineStyle.Medium, ExcelKnownColors.Grey_80_percent);

            for (int r = 3; r < 7; r++)
                for (int c = 1; c < 13; c++)
                    var range = worksheet.Range[r, c];
                    range.Text = string.Format("({0},{1})", r, c);
                    range.CellStyle.Color = Color.White;
                    range.CellStyle.Font.RGBColor = Color.Black;

                    range.BorderAround(ExcelLineStyle.Medium, ExcelKnownColors.Grey_25_percent);

            // Save an Excel file.

            // Convert to image and save.
            var image = worksheet.ConvertToImage(1, 1, 15, 15, ImageType.Bitmap, imageStream, System.Drawing.Imaging.EmfType.EmfOnly);
            image.Save("text.png", System.Drawing.Imaging.ImageFormat.Png);

I've attached a zip file with screenshots of the Excel file and the output PNG. The Excel file looks exactly like I want it to, but the converted image looks nothing like the Excel file. The column headers are not angled, and the text that is supposed to be inside those columns appears to be floating above the columns in the row above.

Am I doing something wrong, or are angled columns just not supported by the ConvertToImage method?


Attachment: Screenshots_92add7ae.zip

Dilli Babu Nandha Gopal [Syncfusion]
Replied On May 14, 2015 09:51 AM UTC

Hi Kenneth,

We would like to inform you that we don’t have the support “To provide angled border in worksheet to image conversion” currently and so have logged feature report regarding this, also we were able to reproduce the issue “Improper text position for rotated text in worksheet to image conversion” and have logged defect report regarding this. The support incidents to track the status of this feature and defect has been created under your account. Please log on to our support website to check for further updates.


Please let me know if you have any questions.

Dilli babu.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon