Copy HSSFSheet from one workbook to another

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

Copy HSSFSheet from one workbook to another

_hz_
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
Reply | Threaded
Open this post in threaded view
|

Re: Copy HSSFSheet from one workbook to another

rahul.soa
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
<[hidden email]> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Copy HSSFSheet from one workbook to another

_hz_
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 <[hidden email]> 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
> <[hidden email]> 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
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Copy HSSFSheet from one workbook to another

rahul.soa
Perhaps POI devs can comment on this...

On Tue, Jun 7, 2011 at 4:37 PM, Hamza Abdelkebir
<[hidden email]> 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 <[hidden email]> 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
>> <[hidden email]> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Copy HSSFSheet from one workbook to another

Rob B
In reply to this post by _hz_
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: [hidden email]
For additional commands, e-mail: [hidden email]