Click here to Skip to main content
15,891,689 members
Articles / Web Development / ASP.NET

Export GridView Data to Excel using OpenXml

Rate me:
Please Sign up or sign in to vote.
4.92/5 (8 votes)
15 Apr 2012CPOL 88.4K   7.6K   18  
ASP.NET GridView to Excel conversion.

namespace GridToExcel.Data
{
    /// <summary>
    /// Implements a test class which has sample student info
    /// </summary>
    internal class MyData
    {
        /// <summary>
        /// Gets or sets the id.
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// Gets or sets the name of the student.
        /// </summary>
        public string StudentName { get; set; }

        /// <summary>
        /// Gets or sets the class id.
        /// </summary>
        public string ClassId { get; set; }

        /// <summary>
        /// Gets or sets the grade code.
        /// </summary>
        public string GradeCode { 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
Software Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions