Just to let you know, I've finally managed to fix this... properly. CVS
is down, so i'll probably check this in tomorrow. Added some extra tests
as well.
Regards
-
Avik
On Tue, 2005-04-19 at 23:36 +0530, [EMAIL PROTECTED] wrote:
> I also cant reconcile this behaviour with the fact that the code
> HSSFWorkbook wb = new HSSFWorkbook();
> HSSFSheet s = wb.createSheet("Sheet1");
>
> in earlier versions of POI produced a book with only ONE sheet called
> 'Sheet1'.
> I think even if we are checking for duplicate names, the above code
> should work
> as before!
>
> Quoting [EMAIL PROTECTED]:
>
> > hey, thanks.
> >
> > I saw that , but what I cant reconcile the fact that everything worked fine
> > before the check for duplicate names was there, (ie, you could create a
> > new wb,
> > and then create a sheet called 'Sheet1' in it) while the bug report
> > claims that
> > creating a sheet with a duplicate name sometimes crashes excel.
> >
> > I could just redo all tests so that we create sheets with other names, but I
> > dont know if that is a good idea!
> >
> > Regards
> > -
> > Avik
> >
> > Quoting Amol Deshmukh <[EMAIL PROTECTED]>:
> >
> >> Avik,
> >>
> >> Following is the stack trace of calls when creating a "new HSSFWorkbook()":
> >>
> >> at
> >> org.apache.poi.hssf.model.Workbook.createBoundSheet(Workbook.java:1664)
> >> at
> >> org.apache.poi.hssf.model.Workbook.createWorkbook(Workbook.java:300)
> >> at
> >> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:120)
> >> at
> >> org.apache.poi.hssf.usermodel.TestFormulas.binomialOperator(TestFormulas.jav
> >> a:456)
> >> at
> >> org.apache.poi.hssf.usermodel.TestFormulas.testPowerIntegers(TestFormulas.ja
> >> va:115)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >> at
> >> org.apache.poi.hssf.usermodel.TestFormulas.main(TestFormulas.java:1090)
> >>
> >> If you see the top of the stack trace above,
> >> file org.apache.poi.hssf.model.Workbook.java creates sheet by name 'Sheet1'
> >> by default.
> >>
> >> This may explain why a subsequent "wb.createSheet("Sheet1")" would fail.
> >>
> >> HTH,
> >> ~ amol
> >>
> >>
> >>
> >>> -----Original Message-----
> >>> From: Avik Sengupta [mailto:[EMAIL PROTECTED]
> >>> Sent: Tuesday, April 19, 2005 9:53 AM
> >>> To: [email protected]
> >>> Subject: Re: State of the Head
> >>>
> >>>
> >>> The following commit:
> >>> http://cvs.apache.org/viewcvs.cgi/jakarta-poi/src/java/org/apa
> >>> che/poi/hssf/usermodel/HSSFWorkbook.java?r1=1.36&r2=1.37
> >>>
> >>> for bug 30951
> >>>
> >>> seemed to have been done without running all tests, probably coz there
> >>> were other tests failing at that time :( .. which is why I have been
> >>> apprehensive of accepting any patch till previous errors have been
> >>> removed.
> >>>
> >>> This commit throws an exception if, while creating a sheet, a sheet
> >>> exits in the workbook with the same name. Which is fine,
> >>> however, there
> >>> seems to be some issue with naming even the first sheet you create as
> >>> 'Sheet1', where the following code fails.
> >>>
> >>> HSSFWorkbook wb = new HSSFWorkbook();
> >>> HSSFSheet s = wb.createSheet("Sheet1");
> >>>
> >>> ie, POI seems to think that a sheet named 'Sheet1' exists
> >>> even in a new
> >>> workbook!
> >>>
> >>> Still investigating.
> >>>
> >>> Regards
> >>> -
> >>> Avik
> >>>
> >>> On Tue, 2005-04-12 at 17:07 +0530, Avik Sengupta wrote:
> >>> > HEAD on our CVS is currently broken (tests dont pass).
> >>> Thats the reason
> >>> > why I haven't been merging patches/bugfixes for a while...
> >>> >
> >>> > including the powerpoint work by Nick (who just added some
> >>> write support
> >>> > today.. cool!)..I plan to play around with Nick's
> >>> powerpoint code, but
> >>> > feel blocked by the fact that head is not all OK..
> >>> >
> >>> > So this mail is to say that any help on this highly
> >>> appreciated :).I'm
> >>> > planning to put some work on this in the next couple of weeks.
> >>> >
> >>> >
> >>> >
> >>> > Regards
> >>> > -
> >>> > Avik
> >>> >
> >>> >
> >>> --
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> Mailing List: http://jakarta.apache.org/site/mail2.html#poi
> >>> The Apache Jakarta POI Project: http://jakarta.apache.org/poi/
> >>>
> >>
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> Mailing List: http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta POI Project: http://jakarta.apache.org/poi/
>
--
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/