Bug 59300 - default sheet name for the 1st sheet has to be "Sheet1" instead pf "Sheet0"
Summary: default sheet name for the 1st sheet has to be "Sheet1" instead pf "Sheet0"
Status: RESOLVED WONTFIX
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-11 15:42 UTC by Vladimir Dolzhenko
Modified: 2016-05-17 23:39 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Dolzhenko 2016-04-11 15:42:11 UTC
When MS Excel, Libreoffice opens - they create an empty spread sheet with name "Sheet1". 

XSSFSheet (and potentially other implementations) calls it "Sheet0" that is inconvenient. 

    public XSSFSheet createSheet() {
        String sheetname = "Sheet" + (sheets.size());
        int idx = 0;
        while(getSheet(sheetname) != null) {
            sheetname = "Sheet" + idx;
            idx++;
        }
        return createSheet(sheetname);
    }


it is worth to change it to 

    public XSSFSheet createSheet() {
        String sheetname = "Sheet" + (sheets.size() + 1);
        int idx = 0;
        while(getSheet(sheetname) != null) {
            sheetname = "Sheet" + idx;
            idx++;
        }
        return createSheet(sheetname);
    }
Comment 1 Javen O'Neal 2016-05-17 23:39:23 UTC
This probably won't be fixed as it introduces a behavior change that may subtly break existing applications, with marginal benefit.

If you need your sheet names to start at "Sheet1", use Workbook#createSheet(String name).