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 2012/02/01 19:33:44 UTC

DO NOT REPLY [Bug 52574] New: Sheet.HeaderMargin & Sheet.FooterMargin only supported in XSSF

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

             Bug #: 52574
           Summary: Sheet.HeaderMargin & Sheet.FooterMargin only supported
                    in XSSF
           Product: POI
           Version: unspecified
          Platform: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: gjungman@utilinc.com
    Classification: Unclassified


The below code works in Excel 2007 (XSSF) but not in 2003 (HSSF).  Excel 2003
has header and footer margins.

Code:
        sheet.setMargin(Sheet.HeaderMargin, headerMargin);
        sheet.setMargin(Sheet.FooterMargin, footerMargin);

Error Stack Trace:


java.lang.IllegalArgumentException: Unknown margin constant:  4

        at
org.apache.poi.hssf.record.aggregates.PageSettingsBlock.getMarginRec(

PageSettingsBlock.java:413)

        at
org.apache.poi.hssf.record.aggregates.PageSettingsBlock.setMargin(Pag

eSettingsBlock.java:442)

        at
org.apache.poi.hssf.usermodel.HSSFSheet.setMargin(HSSFSheet.java:1072

)

        at
com.utilinc.planner.b2.b2ii.B2iiToExcel.toExcel(B2iiToExcel.java:1491

-- 
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 52574] Sheet.HeaderMargin & Sheet.FooterMargin only supported in XSSF

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

Greg Jungman <gj...@utilinc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gjungman@utilinc.com
         OS/Version|                            |All

-- 
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 52574] Sheet.HeaderMargin & Sheet.FooterMargin only supported in XSSF

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2012-02-27 15:34:11 UTC ---
Fixed in r1294181

Actually you could set header/footer margins in HSSF, but in a different
manner:

        sheet.getPrintSetup().setFooterMargin(margin);
and
        sheet.getPrintSetup().setHeaderMargin(margin);

Now setMargin correctly handles all types, the same behavior as in XSSF.

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


DO NOT REPLY [Bug 52574] Sheet.HeaderMargin & Sheet.FooterMargin only supported in XSSF

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

--- Comment #2 from Greg Jungman <gj...@utilinc.com> 2012-02-27 17:10:47 UTC ---
Thanks!!!!

-- 
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