Package excel.copyandmove

Source Code of excel.copyandmove.ApacheCopySheetWithinWorkbook

package excel.copyandmove;

import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;

public class ApacheCopySheetWithinWorkbook
{
  public static void main(String[] args) throws Exception
  {
    Workbook wb = new HSSFWorkbook();
      wb.createSheet("new sheet");
      wb.createSheet("second sheet");
      Sheet cloneSheet = wb.cloneSheet(0);
     
      // now you have to manually copy all the data into new sheet from the cloneSheet
     
      //Print Message
        System.out.println("Cloned successfull.");
  }

}
TOP

Related Classes of excel.copyandmove.ApacheCopySheetWithinWorkbook

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.