private void CreateFilterModeRecord(HSSFSheet sheet, int insertPos) { //look for the FilterModeRecord Chama.Utils.NPOI.HSSF.Record.Record record = sheet.Sheet.FindFirstRecordBySid(FilterModeRecord.sid); // this local variable hides the class one: FilterModeRecord filtermode; //if not found, add a new one if (record == null) { filtermode = new FilterModeRecord(); sheet.Sheet.Records.Insert(insertPos, filtermode); } }
private void CreateAutoFilterInfoRecord(HSSFSheet sheet, int insertPos, Area3DPtg ptg) { //look for the AutoFilterInfo Record Chama.Utils.NPOI.HSSF.Record.Record record = sheet.Sheet.FindFirstRecordBySid(AutoFilterInfoRecord.sid); AutoFilterInfoRecord info; if (record == null) { info = new AutoFilterInfoRecord(); sheet.Sheet.Records.Insert(insertPos, info); } else { info = record as AutoFilterInfoRecord; } info.NumEntries = (short)(ptg.LastColumn - ptg.FirstColumn + 1); }