You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Hamza Abdelkebir <ha...@gmail.com> on 2011/06/01 13:56:25 UTC

Copy HSSFSheet from one workbook to another

Hi all,
I have two xls workbooks and I want to copy a sheet from the first to the
second.

Did anybody had to do such thing before?

Thanks,

-- 
Hamza

Re: Copy HSSFSheet from one workbook to another

Posted by "rahul.soa" <ra...@googlemail.com>.
Perhaps POI devs can comment on this...

On Tue, Jun 7, 2011 at 4:37 PM, Hamza Abdelkebir
<ha...@gmail.com> wrote:
> Hi Rahul,
> Thank you for the link. I'm now able to copy a sheet from one workbook to
> another.
> The problem i'm having now is that the new sheet has not the same properties
> as the original :
> zoom, print margins, etc and a lot of page breaks are generated
> automatically.
> How do I preserve sheet aspect (the original perfectly fit an A4 page).
>
> PS: I am using POI 3.8 beta 3
>
> Thanks,
> Hamza
>
>
> On Thu, Jun 2, 2011 at 8:44 PM, rahul.soa <ra...@googlemail.com> wrote:
>>
>> Hamza,
>>
>> Plz have a look here:
>>
>>
>> http://www.coderanch.com/t/420958/open-source/Copying-sheet-excel-file-another
>>
>> Many Thanks,
>> rahul
>>
>> On Wed, Jun 1, 2011 at 1:56 PM, Hamza Abdelkebir
>> <ha...@gmail.com> wrote:
>> > Hi all,
>> > I have two xls workbooks and I want to copy a sheet from the first to
>> > the
>> > second.
>> >
>> > Did anybody had to do such thing before?
>> >
>> > Thanks,
>> >
>> > --
>> > Hamza
>> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Copy HSSFSheet from one workbook to another

Posted by Rob B <rb...@gmail.com>.
I adapted the Java code from the coderanch link for copying a Sheet to a new
workbook, fixing bugs and getting rid of deprecated usages. The new code
should also copy the sheet properties such as zoom, print margins, page
breaks, etc.

You can find my updated code here:

http://robsnotebook.com/copy-a-sheet-to-a-different-workbook-in-apache-poi



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Copy HSSFSheet from one workbook to another

Posted by Hamza Abdelkebir <ha...@gmail.com>.
Hi Rahul,
Thank you for the link. I'm now able to copy a sheet from one workbook to
another.
The problem i'm having now is that the new sheet has not the same properties
as the original :
zoom, print margins, etc and a lot of page breaks are generated
automatically.

How do I preserve sheet aspect (the original perfectly fit an A4 page).


PS: I am using POI 3.8 beta 3


Thanks,
Hamza


On Thu, Jun 2, 2011 at 8:44 PM, rahul.soa <ra...@googlemail.com> wrote:

> Hamza,
>
> Plz have a look here:
>
>
> http://www.coderanch.com/t/420958/open-source/Copying-sheet-excel-file-another
>
> Many Thanks,
> rahul
>
> On Wed, Jun 1, 2011 at 1:56 PM, Hamza Abdelkebir
> <ha...@gmail.com> wrote:
> > Hi all,
> > I have two xls workbooks and I want to copy a sheet from the first to the
> > second.
> >
> > Did anybody had to do such thing before?
> >
> > Thanks,
> >
> > --
> > Hamza
> >
>

Re: Copy HSSFSheet from one workbook to another

Posted by "rahul.soa" <ra...@googlemail.com>.
Hamza,

Plz have a look here:

http://www.coderanch.com/t/420958/open-source/Copying-sheet-excel-file-another

Many Thanks,
rahul

On Wed, Jun 1, 2011 at 1:56 PM, Hamza Abdelkebir
<ha...@gmail.com> wrote:
> Hi all,
> I have two xls workbooks and I want to copy a sheet from the first to the
> second.
>
> Did anybody had to do such thing before?
>
> Thanks,
>
> --
> Hamza
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org