// Reference the OWC11 (COM component) in the project)
OWC11.SpreadsheetClass xlsheet = new OWC11.SpreadsheetClass ();
// Merge Cells
Xlsheet. get_Range (xlsheet. Cells [], xlsheet. Cells []). set_MergeCells (true );
Xlsheet. ActiveSheet. Cells [] = "Primary Account ";
// Bold font
Xlsheet. get_Range (xlsheet. Cells [], xlsheet. Cells []). Font. set_Bold (true );
// Align the cell text horizontally.
Xlsheet. get_Range (xlsheet. Cells [1, 1], xlsheet. Cells [1, 14]). set_HorizontalAlignment (OWC11.XlHAlign. xlHAlignCenter );
// Set the font size
Xlsheet. get_Range (xlsheet. Cells [], xlsheet. Cells []). Font. set_Size (14 );
// Set the column width
Xlsheet. get_Range (xlsheet. Cells [1, 3], xlsheet. Cells [1, 3]). set_ColumnWidth (50 );
// Draw a border line
Xlsheet. get_Range (xlsheet. Cells [], xlsheet. Cells []). Borders. set_LineStyle (OWC11.XlLineStyle. xlContinuous );
// Write data (this can be generated by DS as needed)
For (int row = 2; row <10; row ++) // note that when writing data, you must write data from the first row without row "0" in EXCEL.
{
For (int I = 0; I <15; I ++)