public void setPrintArea(int sheetIndex, String reference){NameRecord name = workbook.getSpecificBuiltinRecord(NameRecord.BUILTIN_PRINT_AREA, sheetIndex+1);if (name == null) {name = workbook.createBuiltInName(NameRecord.BUILTIN_PRINT_AREA, sheetIndex+1);}String[] parts = COMMA_PATTERN.split(reference);StringBuilder sb = new StringBuilder(32);for (int i = 0; i < parts.length; i++) {if(i>0) {sb.append(",");}SheetNameFormatter.appendFormat(sb, getSheetName(sheetIndex));sb.append("!");sb.append(parts[i]);}name.setNameDefinition(HSSFFormulaParser.parse(sb.toString(), this, FormulaType.NAMEDRANGE, sheetIndex));}
public void SetPrintArea(int sheetIndex, String reference){NameRecord name = workbook.GetSpecificBuiltinRecord(NameRecord.BUILTIN_PRINT_AREA, sheetIndex + 1);if (name == null)name = workbook.CreateBuiltInName(NameRecord.BUILTIN_PRINT_AREA, sheetIndex + 1);String[] parts = reference.Split(new char[]{','});StringBuilder sb = new StringBuilder(32);for (int i = 0; i < parts.Length; i++){if (i > 0){sb.Append(",");}SheetNameFormatter.AppendFormat(sb, GetSheetName(sheetIndex));sb.Append("!");sb.Append(parts[i]);}name.NameDefinition =(HSSFFormulaParser.Parse(sb.ToString(), this, FormulaType.NamedRange, sheetIndex));}