[Bug 61905] New: Sheet.setActiveCell() does nothing

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 61905] New: Sheet.setActiveCell() does nothing

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61905

            Bug ID: 61905
           Summary: Sheet.setActiveCell() does nothing
           Product: POI
           Version: 3.17-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

Created attachment 35612
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35612&action=edit
active cell is A1, instead of E11

The method setActiceCell seems to be not working on latest stable version. The
same method on XSSF is working as expected.

Please find a minimal reproducer below:


    @Test
    public void xlsx() throws IOException {
        XSSFWorkbook wb = new XSSFWorkbook();
        XSSFSheet sheet = wb.createSheet("new sheet");
        sheet.setActiveCell(new CellAddress("E11"));
        wb.write(new FileOutputStream("c:/temp/yyy.xlsx"));
        wb.close();
    }

    @Test
    public void xls() throws IOException {
        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sheet = wb.createSheet("new sheet");
        sheet.setActiveCell(new CellAddress("E11"));
        wb.write(new FileOutputStream("c:/temp/yyy.xls"));
        wb.close();
    }

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61905] Sheet.setActiveCell() does nothing

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61905

--- Comment #1 from Davide Angelocola <[hidden email]> ---
Created attachment 35613
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35613&action=edit
active cell is E11, as expected

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61905] Sheet.setActiveCell() does nothing

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61905

Dominik Stadler <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61905] Sheet.setActiveCell() does nothing

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61905

Dominik Stadler <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #2 from Dominik Stadler <[hidden email]> ---
This works for me with LibreOffice on Linux, can you provide details about your
environment?

Also does the following unit test pass?

    @Test
    public void test61905xlsx() throws IOException {
        Workbook wb = new XSSFWorkbook();
        checkActiveSheet(wb, XSSFITestDataProvider.instance);
        //wb.write(new FileOutputStream("/tmp/yyy.xlsx"));
        wb.close();
    }

    @Test
    public void test61905xls() throws IOException {
        Workbook wb = new HSSFWorkbook();
        checkActiveSheet(wb, HSSFITestDataProvider.instance);
        //wb.write(new FileOutputStream("/tmp/yyy.xls"));
        wb.close();
    }

    private void checkActiveSheet(Workbook wb, ITestDataProvider instance)
throws IOException {
        Sheet sheet = wb.createSheet("new sheet");
        sheet.setActiveCell(new CellAddress("E11"));
        assertEquals("E11", sheet.getActiveCell().formatAsString());

        Workbook wbBack = instance.writeOutAndReadBack(wb);
        sheet = wbBack.getSheetAt(0);
        assertEquals("E11", sheet.getActiveCell().formatAsString());
        wbBack.close();
    }

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61905] Sheet.setActiveCell() does nothing

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61905

Davide Angelocola <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #3 from Davide Angelocola <[hidden email]> ---
I'm using Windows 10 Enterprise with Excel 2016 (MSO 16.0.8201.2207 32-bit).
When I open the file yyy.xls with Excel the cell A1 is marked as active,
instead of E11 (please see the attached screenshot).
Whereas when I open the file yyy.xlsx the cell E11 is marked as active, as
expected.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61905] Sheet.setActiveCell() does nothing

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61905

--- Comment #4 from Davide Angelocola <[hidden email]> ---
Created attachment 35629
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35629&action=edit
proof

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]