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

           Summary: two Page Settings Blocks
           Product: POI
           Version: 3.5-dev
          Platform: PC
               URL: http://www.nabble.com/user/UserProfile.jtp?user=139638
                    5
        OS/Version: Windows XP
            Status: NEW
          Severity: regression
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Hi
I am getting the following error when trying to run the following test case in
TestExcelExtractor.java: 

public void testImportMacroPSB() throws Exception {
        String filename =
"C:\\poi-src-3.5-beta5-20090512\\poi-3.5-beta5\\testOLD\\test.xls";
        InputStream macro = new FileInputStream(filename);
        Workbook oldWb = new HSSFWorkbook(macro);
        assertNotNull(oldWb);
          FileOutputStream out = new FileOutputStream("c:/testPSB.xls");
          oldWb.write(out);
            out.close();

    }


Exception in thread "main" java.lang.RuntimeException: two Page Settings Blocks
found in the same sheet
    at org.apache.poi.hssf.model.Sheet.<init>(Sheet.java:241)
    at org.apache.poi.hssf.model.Sheet.createSheet(Sheet.java:160)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:288)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:202)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:318)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:299)
    at
org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:60)
    at
com.ericsson.ccrtool.excel.impl.write.ExcelSheetComparer.main(ExcelSheetComparer.java:29)

This is not similar to bug
https://issues.apache.org/bugzilla/show_bug.cgi?id=46840. Here the exception is
coming in line number 241 of Sheet.java

The test file I am using here is an old file (1 year old ), When I open the
file and change some cell value then the test case is passed. But I dont want
to open and save all the file each time when ever I am getting the above error. 


I have also run the the POI code BiffViewer.java for both the old file (Which
is giving problem) and the new file (open the old file save the file make new
file) and I found that there is difference in the TABID element of the output
file. In the correct file the element_0 start with counter "1" which was "O" in
the old file.

old file(PSB problem file)

[TABID]
    .elements        = 17
    .element_0 = 0
    .element_1 = 1
    .element_2 = 2
    .element_3 = 3
    .element_4 = 4
    .element_5 = 5
    .element_6 = 6
    .element_7 = 7
    .element_8 = 8
    .element_9 = 9
    .element_10 = 10
    .element_11 = 11
    .element_12 = 12
    .element_13 = 13
    .element_14 = 14
    .element_15 = 15
    .element_16 = 16
[/TABID]


New file (open and save the old file)
[TABID]
    .elements        = 17
    .element_0 = 1
    .element_1 = 2
    .element_2 = 3
    .element_3 = 4
    .element_4 = 5
    .element_5 = 6
    .element_6 = 7
    .element_7 = 8
    .element_8 = 9
    .element_9 = 10
    .element_10 = 11
    .element_11 = 12
    .element_12 = 13
    .element_13 = 14
    .element_14 = 15
    .element_15 = 16
    .element_16 = 17
[/TABID]

I am sorry to say that I cant share my test file as per company privacy rule. 

Please let me know if you could help me on this issue. 

This problem is coming with both Excel 2003 file and Excel 2007 file and I have
taken the latest (14 May 2009) zip file from the POI 3.5 

Waiting for your reply.. 

Thanks and Regards 
Naveen Kumar

-- 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to