Click here to Skip to main content
15,884,388 members
Articles / Productivity Apps and Services / Microsoft Office

Export Tabular Data in PDF Format through the Web

Rate me:
Please Sign up or sign in to vote.
4.57/5 (12 votes)
13 Oct 2011CPOL5 min read 47K   1.3K   21  
This article presents an example to export tabular data in PDF format through the web.
using iTextSharp.text;

namespace iTextTabularReport.Utilities
{
    public class ReportColumn
    {
        public string ColumnName { get; set; }
        public int Width { get; set; }

        private string headerText;
        public string HeaderText { set { headerText = value; }
            get { return headerText ?? ColumnName; } }
    }

    public class ReportConfiguration
    {
        // Overall page layout, orientation and margins
        private Rectangle pageOrientation = PageSize.LETTER;
        private int marginLeft = 30;
        private int marginTop = 20;
        private int marginRight = 30;
        private int marginBottom = 30;

        public Rectangle PageOrientation { get { return pageOrientation; }
            set { pageOrientation = value; } }
        public int MarginLeft { get { return marginLeft; } set { marginLeft = value; } }
        public int MarginTop { get { return marginTop; } set { marginTop = value; } }
        public int MarginRight { get { return marginRight; } set { marginRight = value; } }
        public int MarginBottom { get { return marginBottom; } set { marginBottom = value; } }

        // Logo - Logo is always placed at the top left corner
        private int logImageScalePercent = 100;
        public string LogoPath { get; set; }
        public int LogImageScalePercent { get { return logImageScalePercent; }
            set { logImageScalePercent = value; } }

        // Title and subtitle. Titles are always center aligned at the top.
        public string ReportTitle { get; set; }
        public string ReportSubTitle { get; set; }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
I have been working in the IT industry for some time. It is still exciting and I am still learning. I am a happy and honest person, and I want to be your friend.

Comments and Discussions