Click here to Skip to main content
12,512,130 members (51,475 online)
Click here to Skip to main content

Tagged as

Stats

373.1K views
20K downloads
261 bookmarked
Posted

Generate Excel files without using Microsoft Excel

, 22 Jun 2011 CPOL
A C# class to create Excel files without requiring Microsoft Excel.
ConsoleApplication1
ConsoleApplication1
bin
Debug
ConsoleApplication1.exe
ConsoleApplication1.pdb
ConsoleApplication1.vshost.exe
demo.xls
ConsoleApplication1.vbproj.user
My Project
Application.myapp
obj
Debug
ConsoleApplication1.exe
ConsoleApplication1.pdb
ConsoleApplication1.Resources.resources
ConsoleApplication1.vbproj.GenerateResource.Cache
ConsoleApplication1.vbproj.ResolveComReference.cache
TempPE
ConsoleApplication1.suo
XLSExportDemo
XLSExportDemo
Properties
// C# Excel Writer library v2.0
// by Serhiy Perevoznyk, 2008-2011

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace XLSExportDemo
{
    internal class CellInfo
    {
        private object value;

        public CellInfo(ExcelDocument document)
        {
            BackColor = ExcelColor.Automatic;
            ForeColor = ExcelColor.Automatic;
            Font = document.DefaultFont;
            this.Document = document;
        }

        internal byte FXIndex { get; set; }
        public ExcelDocument Document { get; set; }

        public object Value
        {
            get { return value; }
            set
            {
                this.value = value;
                if (value is DateTime)
                    this.Format = Document.Formats[15];
            }
        }
        
        public string Format { get; set; }
        public ExcelColor BackColor { get; set; }
        public ExcelColor ForeColor { get; set; }
        public int Row { get; set; }
        public int Column { get; set; }
        public Font Font { get; set; }
        public Alignment Alignment { 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)

Share

About the Author

Serhiy Perevoznyk
Architect
Belgium Belgium
No Biography provided

You may also be interested in...

Pro
Pro
| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160929.1 | Last Updated 22 Jun 2011
Article Copyright 2009 by Serhiy Perevoznyk
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid