poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger Studner <rstud...@gmail.com>
Subject Re: I'm sure this has been asked 1000x times
Date Tue, 20 Jul 2010 11:53:07 GMT
So, in essence, no.. there is no means to *copy* anything.  One simply recreates, fully, cell
for cell, entire workbooks.

amazing

Roger




On Jul 20, 2010, at 2:36 AM, MSB wrote:

> 
> You will not be able to copy rows from one workbook to another but you can
> copy cells.
> 
> Setting aside the issue of styles for a moment - although even that is
> fairly straightforward as there is a method available to clone a style from
> another workbook and the only major hurdle that leaves is preventing the
> creation of too many styles, so style pooling I guess you could call it -
> all you will need to do is;
> 
> Open the 'source' and 'destination' workbooks.
> Get the sheet the data should be written to from the 'destination' workbook.
> Get a sheet from the 'source' workbook.
> While there are rows to be processed on the source sheet.
>   Get a row from the source sheet.
>   While there are cells to be processed on that row.
>      Read a cell from the 'source' workbook.
>      Test it to see whether it meets your citeria.
>      If it does pass; 
>         Get the type of the cell so that you can recover the value in the
> appropriate format
>         Create a new cell in the 'destination' workbooks sheet.
>         Initialise the newly created cell.
> 
> If your test is to see what the contents of the first cell in the row are
> and then copy all of the cells in that row should it pass, then there need
> only be a slight modification to the algorithm.
> 
> That ought to do the trick for now, styles are something that you could look
> into later when you have the copying part of the routine working correctly.
> 
> Yours
> 
> Mark B
> 
> 
> OreoC wrote:
>> 
>> I'm trying to duplicate parts of a spreadsheet (the other option being to
>> use creative shiftRows).
>> 
>> Anyway.. i'd like to be able to copy rows, from one spreadsheet to
>> another.
>> I realize workbook/worksheet styles are a particular issue
>> 
>> THat being said.. I can't seem to, even using groovy/violating the
>> protected methods (get/set row record) find any way to do this
>> 
>> Is there any easy method, than literally a cell by cell
>> introspection/recreation?
>> 
>> essentially 'im juust trying to include rows that pass a boolean
>> operation.. seemingly trivial stuff
>> 
>> Thanks,
>> Roger
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>> 
>> 
>> 
> 
> -- 
> View this message in context: http://old.nabble.com/I%27m-sure-this-has-been-asked-1000x-times-tp29210376p29211837.html
> Sent from the POI - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 


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


Mime
View raw message