Creating Subtotals

The following code provides an example of how to format the cells of a book.

1.   Add a reference to C1.Silverlight.Excel.dlland create a C1XLBook.

2.   Add code to format the cells.

3.   Save the workbook. The code looks like the following. In this example it is placed within a button1_Click event so the Save As dialog box will open when the user clicks the button

       C#

4.   Run the program. Save and open the file. The spreadsheet will look similar to the following:



The SUBTOTAL formulas get the sum of the specified rows.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.