using System; using System.Text; using System.IO; using NPOI.HSSF.UserModel; using NPOI.HPSF; using NPOI.POIFS.FileSystem; using NPOI.HSSF.UserModel.Contrib; using NPOI.SS.Util; using NPOI.SS.UserModel; namespace MergeCellsInXls { class Program { static void Main(string[] args) { InitializeWorkbook(); Sheet sheet = hssfworkbook.CreateSheet("new sheet"); Row row = sheet.CreateRow(0); row.HeightInPoints = 30; Cell cell = row.CreateCell(0); //set the title of the sheet cell.SetCellValue("Sales Report"); CellStyle style = hssfworkbook.CreateCellStyle(); style.Alignment = HorizontalAlignment.CENTER; //create a font style Font font = hssfworkbook.CreateFont(); font.FontHeight = 20*20; style.