public Table(Sheet sheet, string title, params string[] columnHeaders) { _cols = new Columns(this); _rows = new Rows(this); _title = title; _fields = new Fields(this); _sheet = sheet; _cols.Add(columnHeaders); }
public Table(Sheet sheet, int numberOfColumnsWithNoHeader) { _sheet = sheet; _cols = new Columns(this); _rows = new Rows(this); _title = ""; _fields = new Fields(this); _cols.Add(numberOfColumnsWithNoHeader); }
public Sheet Add(Sheet sheet) { List.Add(sheet); return sheet; }
/*public string[] PrintText{ get{ //TODO: This isn't done. I might can be used to shink the width of a report to make it fit on a page. int colWidth; string rowString = ""; ArrayList printText = new ArrayList(); foreach(Sheet sheet in _sheets){ foreach(Table table in sheet.Tables){ colWidth = (93 / table.Columns.Count) - Table.COLUMN_PAD; foreach(Row row in table.Rows){ foreach(Field fld in row.Fields){ if (fld.Value.Length > colWidth) fldVal = fld.Value.Substring(1, colWidth); else fldVal = fld.Value.PadRight( //rowString = fld.Value.Substring(1, colWidth) + " ".PadRight(Table.COLUMN_PAD); //printText.Add(rowString); } } } return (string[])printText.ToArray(); } }*/ protected Table CreateDefaultTable(string title, params string[] columnHeaders) { Table table; Sheet sheet; if (_sheets[0] == null){ sheet = new Sheet(this,title); _sheets.Add(sheet); table = new Table(sheet, title, columnHeaders); sheet.Add(table); }else{ table = _sheets[0][0]; } return table; }
public void DeleteDefaultWorksheets(Excel.Workbook wb, Sheet sheet) { Excel.Sheets excelSheets = wb.Sheets; foreach(Excel.Worksheet wsToDel in excelSheets){ if (wb.Name != sheet.Title){ wsToDel.Delete(); } } Marshal.ReleaseComObject(excelSheets); excelSheets = null; }
public Sheet CreateSheet(string title) { Sheet sheet = new Sheet(this, title); _sheets.Add(sheet); return sheet; }
public void Table(Sheet sheet) { _sheet = sheet; }