Hi Anthony ,

Thanks for your suggestion. I check the code about copyCell. It copy the
style:


public static void copyCell(HSSFCell oldCell, HSSFCell newCell,
                        boolean copyStyle) {
                if (copyStyle) {
                        newCell.setCellStyle(oldCell.getCellStyle());
                }


It invokes copyCell as:
copyCell(oldCell, newCell, true);

Does the style including font and color? If it does, why it doen't copy font
and color, even the code already set copyStyle boolean as true? Any idea.

George







Anthony Andrews wrote:
> 
> Thjat is good news, thanks for letting me know because I remembr following
> the original discussion and was never sure how everything was resolved.
> 
> The Font and colour info are both a part of the cells style. I have not
> had the chance to look at the code but I would guess that if you looked
> for the part where it copies the style - assuming it does of course - 
> then the change could be put in there. The only problem you may need to
> bear in mind when copying styles is that Excel imposes a maximum number of
> cell styles.
> 
> --- On Wed, 8/27/08, gliao <[EMAIL PROTECTED]> wrote:
> From: gliao <[EMAIL PROTECTED]>
> Subject: Re: merge worksheets from mutiple xls files
> To: [email protected]
> Date: Wednesday, August 27, 2008, 7:57 AM
> 
> Hi Anthony and Suyash,
> 
> Thanks a lot for your reply. 
> 
> Anthony, the code you provided can copy sheet. The only issue is it
> doesn't
> copy the font and color information of the original sheet, it only copy
> the
> content.
> 
> Regards,
> 
> George 
> 
> 
> 
> 
> Anthony Andrews wrote:
>> 
>> I have searched the archive and found this;
>> 
>>
> http://jxls.cvs.sourceforge.net/jxls/jxls/src/java/org/jxls/util/Util.java?view=markup
>> 
>> Do not know if it is exactly what you require and I have not tested it my
>> self but it may be worth a look.
>> 
>> Otherwise, as another poster has suggested, you will have to code your
>> own
>> method that copies across the cells one by one from one sheet to another.
>> 
>> --- On Tue, 8/26/08, Suyash Jape <[EMAIL PROTECTED]> wrote:
>> From: Suyash Jape <[EMAIL PROTECTED]>
>> Subject: Re: merge worksheets from mutiple xls files
>> To: "POI Users List" <[email protected]>
>> Date: Tuesday, August 26, 2008, 8:41 PM
>> 
>> As far as i have searched, you may have to copy the cells row wise for 
>> each sheet into the target workbook.
>> There doesnt seem to be a copy sheet function for the workbook.
>> 
>> Regards
>> Suyash 
>> 
>> 
>> 
>> gliao <[EMAIL PROTECTED]> 
>> 27-08-2008 01:05
>> Please respond to
>> "POI Users List" <[email protected]>
>> 
>> 
>> To
>> [email protected]
>> cc
>> 
>> Subject
>> merge worksheets from mutiple xls files
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> I want to merge worksheets from multiple xls files into a single workbook
>> with all those sheets. I can't find POI API to implement that. Any
>> suggestion? Thanks.
>> -- 
>> View this message in context: 
>>
> http://www.nabble.com/merge-worksheets-from-mutiple-xls-files-tp19168828p19168828.html
>> 
>> Sent from the POI - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> ForwardSourceID:NT0000691E 
>> =====-----=====-----=====
>> Notice: The information contained in this e-mail
>> message and/or attachments to it may contain 
>> confidential or privileged information. If you are 
>> not the intended recipient, any dissemination, use, 
>> review, distribution, printing or copying of the 
>> information contained in this e-mail message 
>> and/or attachments to it are strictly prohibited. If 
>> you have received this communication in error, 
>> please notify us by reply e-mail or telephone and 
>> immediately and permanently delete the message 
>> and any attachments. Thank you
>> 
>> 
>> 
>> 
>> 
>>       
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/merge-worksheets-from-mutiple-xls-files-tp19168828p19182802.html
> Sent from the POI - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/merge-worksheets-from-mutiple-xls-files-tp19168828p19222497.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to