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

            Bug ID: 55661
           Summary: Support for option "shrink to fit"
           Product: POI
           Version: 3.9
          Hardware: PC
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: XSSF
          Assignee: [email protected]
          Reporter: [email protected]

Hi,
excel provides the option "shrink to fit" for a cell, which autosizes the
content of the cell, if it is too long.
Unfortunately it is not possible to set this option using POI.

Since the class
"org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellAlignment" already
supports this option, the necessessary enhancement should be quite simple.
I just need the following methods in XSSFCellStyle:

public void setShrinkToFit(boolean shrinkToFit) {
    getCellAlignment().setShrinkToFit(shrinkToFit);
}

public boolean getShrinkToFit() {
    CTCellAlignment align = _cellXf.getAlignment();
    return align != null && align.isSetShrinkToFit();
}

Regards
Oliver

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to