You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2011/03/10 22:18:34 UTC

DO NOT REPLY [Bug 50912] New: Applying an HSSFCellStyle on an HSSFCell has no effect

https://issues.apache.org/bugzilla/show_bug.cgi?id=50912

           Summary: Applying an HSSFCellStyle on an HSSFCell has no effect
           Product: POI
           Version: 3.8-dev
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: martin.studer@mirai-solutions.com


Created an attachment (id=26761)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26761)
Template Excel file with user-defined cellstyle "FatFont"

Please see the following snippet of code which detects a user-defined cellstyle
in an Excel file and then tries to apply this celstyle on the top left cell in
the 'MySheet' worksheet.

HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream("template.xls"));
        for(short i = 0; i < wb.getNumCellStyles(); i++) {
            HSSFCellStyle cs = wb.getCellStyleAt(i);
            String userStyleName = cs.getUserStyleName();
            if(userStyleName != null && userStyleName.equals("FatFont")) {
                System.out.println("Found!");
                wb.getSheet("MySheet").getRow(0).getCell(0).setCellStyle(cs);
                break;
            }
        }

        FileOutputStream fos = new FileOutputStream("template2.xls");
        wb.write(fos);
        fos.close();

When opening template2.xls it can be seen that applying the detected cellstyle
actually had no effect.

Please find the file template.xls attached.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 50912] Applying an HSSFCellStyle on an HSSFCell has no effect

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50912

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |skiping@gmail.com

--- Comment #2 from Yegor Kozlov <ye...@dinom.ru> 2011-03-11 12:35:25 EST ---
*** Bug 50302 has been marked as a duplicate of this bug. ***

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 50912] Applying an HSSFCellStyle on an HSSFCell has no effect

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50912

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
         OS/Version|                            |All

--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2011-03-11 12:34:17 EST ---
Fixed in r1080689

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org