ActiveReports 6 Online Help
Basic Spreadsheet with SpreadBuilder

Included with the ActiveReports Excel export filter is the SpreadBuilder API. With this utility, you can create Excel spreadsheets cell by cell for maximum control. This walkthrough illustrates how to create a simple custom spreadsheet cell by cell, and save it to an Excel file.

This walkthrough is split up into the following activities:

When you have completed this walkthrough, a custom Excel file like the following is created in the Bin/Debug subfolder of your project's folder.

To add the export filter to your project

  1. Drag the XlsExport export control from the appropriate Visual Studio toolbox tab onto a Windows Form. (See Adding ActiveReports Controls for information if you haven't added the control to your toolbox.)
  2. The control is visually represented in a component tray below the Windows Form and a reference to ActiveReports.XlsExport is added to your class references.

To add an ActiveReport.Document reference to your project

  1. From the Visual Studio Project menu, select Add New Item.
  2. In the Add New Item window that appears, select ActiveReports 6 (code-based) File and click the Add button. This adds an ActiveReport to the project.
  3. You can delete the ActiveReport, leaving the ActiveReports.Document reference in your class references.

To write the code to create a workbook in Visual Basic or C#

Double-click the title bar of the Windows Form to create an event-handling method for the Form_Load event. Add code to the handler to:

The following example shows what the code for the method looks like.

To write the code in Visual Basic.NET

To write the code in C#

To view the Excel File

  1. Press F5 to run the project. A message box informs you of the exact location of the exported x.xls file.
  2. Navigate to the Bin/Debug subfolder of your project's folder and open the XLS file.
See Also

Getting Started

Concepts