You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Trask, Dennis" <De...@NielsenMedia.com> on 2003/07/31 21:04:05 UTC
Cloning Sheet to New Workbook
My apologies if this has already been covered, but my cursory search of the
archives did not provide results...
I would like to clone sheets from several workbooks and combine them into a
new workbook. In other words, I want Sheet 1 from Workbook 1 to be Sheet 1
in the new workbook. Then, I want Sheet 1 from Workbook 2 to be Sheet 2 in
the new workbook. [And so on...]
Using POI, can I perform a wholesale clone of a sheet and place it into a
new workbook in this manner?
Thanks, in advance,
Dennis Trask
Nielsen Media Research
dennis.trask@nielsenmedia.com
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
Re: Errors in Reading a large excel file
Posted by Prashanthi Maramreddy <ma...@childpsych.columbia.edu>.
>
>
>>Hello:
>>
>>
>>
>> I have been using the POI application to read data from excel file. I
>>recently noticed that whenever I try to read excel file with over 300
>>rows it generates the following error message. However, this does not
>>happen while reading a smaller excel file. I would like to know if there
>>is any limitation on the size of the HSSFWorkbook or HSSFSheet. If so
>>what is it? If not could you please get back to me on the below
>>generated error.
>>
>>
>>
>>
>>
>>
>>
>>java.lang.NegativeArraySizeException:
>>
>>
>>
>>at
>>org.apache.poi.hssf.record.SSTDeserializer.readStringRemainder(SSTDeserializer.java:335)
>>
>>
>>
>>at
>>org.apache.poi.hssf.record.SSTDeserializer.processContinueRecord(SSTDeserializer.java:320)
>>
>>
>>
>>at
>>org.apache.poi.hssf.record.SSTRecord.processContinueRecord(SSTRecord.java:540)
>>
>>
>>
>>at
>>org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:210)
>>
>>
>>
>>at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:140)
>>
>>
>>
>>at edu.columbia.jade.system.DBDialog.readTheExcelFile(DBDialog.java:4790)
>>
>>
>>
>>at
>>edu.columbia.jade.system.DBDialog.generateTheQuestionaire(DBDialog.java:3148)
>>
>>
>>
>>at
>>edu.columbia.jade.system.DBDialog.importMenuItem_ActionPerformed(DBDialog.java:4226)
>>
>>
>>
>>at edu.columbia.jade.system.DBDialog.connEtoC15(DBDialog.java:458)
>>
>>
>>
>>at edu.columbia.jade.system.DBDialog.access$29(DBDialog.java:454)
>>
>>
>>
>>at
>>edu.columbia.jade.system.DBDialog$IvjEventHandler.actionPerformed(DBDialog.java:125)
>>
>>
>>
>>at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1461)
>>
>>
>>
>>at
>>javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1515)
>>
>>
>>
>>at
>>javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:392)
>>
>>
>>
>>at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:264)
>>
>>
>>
>>at javax.swing.AbstractButton.doClick(AbstractButton.java:290)
>>
>>
>>
>>at
>>javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:957)
>>
>>
>>
>>at java.awt.Component.processMouseEvent(Component.java:3799)
>>
>>
>>
>>at java.awt.Component.processEvent(Component.java:3628)
>>
>>
>>
>>at java.awt.Container.processEvent(Container.java:1195)
>>
>>
>>
>>at java.awt.Component.dispatchEventImpl(Component.java:2678)
>>
>>
>>
>>at java.awt.Container.dispatchEventImpl(Container.java:1244)
>>
>>
>>
>>at java.awt.Component.dispatchEvent(Component.java:2581)
>>
>>
>>
>>at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2487)
>>
>>
>>
>>at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2252)
>>
>>
>>
>>at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2161)
>>
>>
>>
>>at java.awt.Container.dispatchEventImpl(Container.java:1231)
>>
>>
>>
>>at java.awt.Window.dispatchEventImpl(Window.java:964)
>>
>>
>>
>>at java.awt.Component.dispatchEvent(Component.java:2581)
>>
>>
>>
>>at java.awt.EventQueue.dispatchEvent(EventQueue.java:434)
>>
>>
>>
>>at
>>java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:172)
>>
>>
>>
>>at
>>java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:131)
>>
>>
>>
>>at java.awt.Dialog.show(Dialog.java:394)
>>
>>
>>
>>at edu.columbia.jade.system.DBDialog.showDialog(DBDialog.java:5635)
>>
>>
>>
>>at edu.columbia.jade.system.SystemMain.showDBDialog(SystemMain.java:2822)
>>
>>
>>
>>at
>>edu.columbia.jade.system.SystemMain.openFileMenuItem_ActionPerformed(SystemMain.java:2277)
>>
>>
>>
>>at edu.columbia.jade.system.SystemMain.connEtoC3(SystemMain.java:449)
>>
>>
>>
>>at edu.columbia.jade.system.SystemMain.access$6(SystemMain.java:445)
>>
>>
>>
>>at
>>edu.columbia.jade.system.SystemMain$IvjEventHandler.actionPerformed(SystemMain.java:82)
>>
>>
>>
>>at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1461)
>>
>>
>>
>>at
>>javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1515)
>>
>>
>>
>>at
>>javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:392)
>>
>>
>>
>>at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:264)
>>
>>
>>
>>at javax.swing.AbstractButton.doClick(AbstractButton.java:290)
>>
>>
>>
>>at
>>javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:957)
>>
>>
>>
>>at java.awt.Component.processMouseEvent(Component.java:3799)
>>
>>
>>
>>at java.awt.Component.processEvent(Component.java:3628)
>>
>>
>>
>>at java.awt.Container.processEvent(Container.java:1195)
>>
>>
>>
>>at java.awt.Component.dispatchEventImpl(Component.java:2678)
>>
>>
>>
>>at java.awt.Container.dispatchEventImpl(Container.java:1244)
>>
>>
>>
>>at java.awt.Component.dispatchEvent(Component.java:2581)
>>
>>
>>
>>at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2487)
>>
>>
>>
>>at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2252)
>>
>>
>>
>>at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2161)
>>
>>
>>
>>at java.awt.Container.dispatchEventImpl(Container.java:1231)
>>
>>
>>
>>at java.awt.Window.dispatchEventImpl(Window.java:964)
>>
>>
>>
>>at java.awt.Component.dispatchEvent(Component.java:2581)
>>
>>
>>
>>at java.awt.EventQueue.dispatchEvent(EventQueue.java:434)
>>
>>
>>
>>at
>>java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:172)
>>
>>
>>
>>at
>>java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:131)
>>
>>
>>
>>at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:126)
>>
>>
>>
>>at java.awt.EventDispatchThread.run(EventDispatchThread.java:118)
>>
>>
>>
>>
>>
>>Prashanthi.
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>Mailing List: http://jakarta.apache.org/site/mail2.html#poi
>>The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
>>
>>
>>
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>Mailing List: http://jakarta.apache.org/site/mail2.html#poi
>The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
Re: Cloning Sheet to New Workbook
Posted by "Andrew C. Oliver" <ac...@apache.org>.
There is no technical reason why this feature can't be added (though not
"setSheet", that's very deceptive of what is really going on)... Its just a
lot of work.
On 7/31/03 3:17 PM, "Avik Sengupta" <av...@apache.org> wrote:
> I imagine not.. there isnt a workbook.setSheet(..) method.
>
> I suppose the difficulty in implementing something like this is that in
> both the object model AND the fileformat, a sheet can contain references
> to global objects in the workbook.
>
> On Fri, 2003-08-01 at 00:34, Trask, Dennis wrote:
>> My apologies if this has already been covered, but my cursory search of the
>> archives did not provide results...
>>
>> I would like to clone sheets from several workbooks and combine them into a
>> new workbook. In other words, I want Sheet 1 from Workbook 1 to be Sheet 1
>> in the new workbook. Then, I want Sheet 1 from Workbook 2 to be Sheet 2 in
>> the new workbook. [And so on...]
>>
>> Using POI, can I perform a wholesale clone of a sheet and place it into a
>> new workbook in this manner?
>>
>> Thanks, in advance,
>> Dennis Trask
>> Nielsen Media Research
>> dennis.trask@nielsenmedia.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>> Mailing List: http://jakarta.apache.org/site/mail2.html#poi
>> The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List: http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
>
--
Andrew C. Oliver
http://www.superlinksoftware.com/poi.jsp
Custom enhancements and Commercial Implementation for Jakarta POI
http://jakarta.apache.org/poi
For Java and Excel, Got POI?
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
Re: Cloning Sheet to New Workbook
Posted by Avik Sengupta <av...@apache.org>.
I imagine not.. there isnt a workbook.setSheet(..) method.
I suppose the difficulty in implementing something like this is that in
both the object model AND the fileformat, a sheet can contain references
to global objects in the workbook.
On Fri, 2003-08-01 at 00:34, Trask, Dennis wrote:
> My apologies if this has already been covered, but my cursory search of the
> archives did not provide results...
>
> I would like to clone sheets from several workbooks and combine them into a
> new workbook. In other words, I want Sheet 1 from Workbook 1 to be Sheet 1
> in the new workbook. Then, I want Sheet 1 from Workbook 2 to be Sheet 2 in
> the new workbook. [And so on...]
>
> Using POI, can I perform a wholesale clone of a sheet and place it into a
> new workbook in this manner?
>
> Thanks, in advance,
> Dennis Trask
> Nielsen Media Research
> dennis.trask@nielsenmedia.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List: http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/