/* * Created on Feb 23, 2004 * Create by TimW * */ import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFSheet; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; /** * The purpose of this class is to * * @author TimW * @version 1.0 */ public class ImageResizeExample { private POIFSFileSystem fs; private HSSFWorkbook wb = null; private HSSFSheet sheet1 = null; public ImageResizeExample(String templateFileURL) throws IOException { fs = new POIFSFileSystem(new FileInputStream(templateFileURL)); wb = new HSSFWorkbook(fs); sheet1 = wb.getSheetAt(0); //Here is where we alter the width of the first column sheet1.setColumnWidth((short)0, (short)10000); FileOutputStream fileOut = new FileOutputStream("ImageResizeExampleOutput.xls"); wb.write(fileOut); fileOut.close(); } public static void main(String[] args) throws IOException { ImageResizeExample test = new ImageResizeExample("ImageResizeExampleTemplate.xls"); } }