Quantcast
Channel: Developer Express Inc.
Viewing all articles
Browse latest Browse all 2370

WinForms Spreadsheet Control (coming in 13.1)

$
0
0

Whether we like it or not, the spreadsheet has become a de facto analysis tool for small datasets. Its debut in June of 1979 as a software package called VisiCalc predated my own birth by an entire month!

VisiCalc 
Source: http://commons.wikimedia.org/wiki/File:Visicalc.png

Since then there have been a number of revisions and consolidations culminating in the widely known software package we all know and love: Microsoft Excel. At DevExpress we recognize the importance spreadsheets and wanted to empower our users to take advantage of the rich facilities this tool provides without the hassle of having to learn a complex API or interact with foreign runtimes. To give you an idea of how easy it is to work with our client agnostic API I wrote a simple console application that generates an entire Excel spreadsheet in about 5 minutes:

// 1. Creating document
DocumentModel doc = new DocumentModel();
doc.Sheets.Add(new Worksheet(doc, "mysheet"));
var sheet = doc.ActiveSheet;

// 2. Adding Data
Random r = new Random(DateTime.Now.Millisecond);
for (int i = 0; i < 15; i++)
    for (int j = 0; j < 20; j++)
    {
        sheet[i, j].Value = r.NextDouble() * 100;
        if ((i + j) % 2 == 0)
            sheet[i, j].Font.Color = Color.Red;
        else
            sheet[i, j].Font.Color = Color.Blue;
    }

// 3. Saving Spreadsheet
using (var stream = File.OpenWrite("myfile.xls"))
    doc.SaveDocument(stream, DevExpress.Spreadsheet.DocumentFormat.Xls, "");

As is to be expected, the largest portion of the application deals with generating data. Notice how easy it is to access, edit, and style each individual cell. During our initial usability tests I mentioned to the development team that there were a number of things we should be able to do easily and without much ceremony. I then sat down and tried to implement a couple of things I thought should be easy. Within a matter of minutes I had completed each task without assistance or intervention from the development team.

One of the tasks that proved to be the easiest was using the SpreadsheetControl inside of a WinForms application. In a couple of clicks you can create a fully functioning spreadsheet application complete with formatting, layout, forumlas, etc.:

DevExpress Spreadsheet Control

I am extremely proud of the work that has been done in order to get these great tools to you, our valued customer.

As always, if there are any comments and/or questions, feel free to get a hold of me!

Seth Juarez
Email: sethj@devexpress.com
Twitter: @SethJuarez


Viewing all articles
Browse latest Browse all 2370

Trending Articles