If you have ever tried to use a Web application to create spreadsheets or reports, you know how difficult it is to create an Excel document solely through code. There have been a number of third-party solutions over the years for ASP and ASP.NET applications, with add-ins, ActiveX controls, server controls and more. But sometimes it's the simplest solutions that are best.
Aspose.Excel is a component available from Aspose, a Sydney-based software company that makes .NET components for creating Office documents from Web applications, including Microsoft's Word, Excel, Project, and PowerPoint, as well as components for creating PDF files, charts, and more.
You can download a trial of Aspose.Excel from their Web site. When you first install the product you may be a bit confused as to how to get started. The installation will create a program group that contains the API reference, as well as links to further documentation and sample applications. The sample applications are a good place to start, as shown below in Figure 1:
Figure 1: Sample applications
There are a couple of different sets of sample applications, depending on which .NET language you are using and they are easy to follow and modify for your own purposes.
The easiest way to get started with Aspose is to use the "template" method where you design your Excel spreadsheet with all of the formatting attributes you want and then use Aspose to populate this template. Aspose calls these spreadsheet templates "Designer" spreadsheets and if you don't want to use this method, you can always generate the entire spreadsheet, but given the formatting requirements that most users will have, the template method is the easiest.
To get started, you will need to create a new Excel spreadsheet with all of the headers, footers, etc. that you require. From that point, you can create a normal dataset and pass the dataset to the spreadsheet template and view or download the spreadsheet, as shown below in Figure 2.
Figure 2: A sample spreadsheet
In addition to basic formatting, Aspose extends spreadsheet generation through the use of "Smart Markers" that can be used with a template to designate a data source, field name, and so forth.
Through the use of the API and this feature, you can create complex spreadsheets and reports that will meet most requirements. Also, generating the entire spreadsheet on-demand through the API is a perfect solution for applications that need to generate reports or spreadsheets on the fly.
And charting is not left out either, with the "Enterprise Edition" of Aspose.Excel adding functionality to create custom charts and graphs within an Excel spreadsheet. This functionality supports the basic chart types within Excel and produces good results with a minimum of coding.
So if you are developing an ASP.NET application and need to deliver information in a presentation-quality format, Aspose.Excel is definitely worth having a look