You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by indian scorpio <co...@gmail.com> on 2008/03/13 10:39:09 UTC

[PLZ read before saying FAQ-13] Some text formatting may have changed...

Hi

Error is some text formatting may have changed as maximum number of styles
exceeded...

I am not setting style & font in any loop but this particular function
printToExcel is being called a lot of times but style setting part is done
only for the first row (ie only once for each sheet) of each sheet in the
file (though in one of the sheet no of column exceeds 52..but neways i m not
doing it for each column so it shouldn't rally matter  (could it be coz of
that))

    void printToExcel() {
>         String workBook = null;
>         workBook = java.lang.System.getProperty("abc");
>         if (workBook == null) {
>             return;
>         }
>         int maxRecordAllowed;
>         maxRecordAllowed = Integer.valueOf(
>                 java.lang.System.getProperty("qwer", Integer.toString
> (2000)))
>                 .intValue();
>         java.io.FileOutputStream fileOut = null;
>         HSSFWorkbook wb = null;
>         try {
>             POIFSFileSystem fs = new POIFSFileSystem(
>                     new java.io.FileInputStream(workBook));
>             wb = new HSSFWorkbook(fs);
>         } catch (Exception e) {
>             wb = new HSSFWorkbook();
>         }
>
>         try {
>
>             fileOut = new java.io.FileOutputStream(workBook);
>             HSSFSheet newSheet = null;
>             newSheet = wb.getSheet("xyz");
>
>             font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
>             short rowIndex;
>             HSSFRow row;
>
> *if (newSheet == null) {*
>
*            HSSFFont font;
>             font = wb.createFont();
>             wb.getF
>             font.setFontHeightInPoints((short) 10);
>             font.setFontName("Arial");
> *
> *            HSSFCellStyle style;
>             style = wb.createCellStyle();
>             style.setFont(font);
>             style.setFillForegroundColor(HSSFColor.LEMON_CHIFFON.index);
>             style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); *
>

> * // do something which uses style
>             } else{*
>
*//do something else
> *
>
*} *
>