<%@ page import="org.apache.poi.hssf.usermodel.HSSFSheet"%> <%@ page import="org.apache.poi.hssf.usermodel.HSSFWorkbook"%> <%@ page import="org.apache.poi.hssf.usermodel.HSSFPrintSetup"%> <%@ page import="org.apache.poi.hssf.usermodel.HSSFPatriarch"%> <%@ page import="org.apache.poi.hssf.usermodel.HSSFClientAnchor"%> <%@ page import="org.apache.poi.hssf.usermodel.HSSFSimpleShape"%> <%@ page import="org.apache.poi.hssf.usermodel.HSSFShape"%> <%@ page contentType="application/vnd.ms-excel" %> <%@ page import="java.io.*" %> <%@ page import="java.util.*" %> <% try{ HSSFWorkbook hwb = new HSSFWorkbook(); HSSFSheet sheet = hwb.createSheet("new sheet"); HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); HSSFClientAnchor a2 = new HSSFClientAnchor( 0, 0, 1023, 255, (short) 1, 0, (short) 5, 0 ); HSSFSimpleShape shape2 = patriarch.createSimpleShape(a2); shape2.setShapeType(HSSFSimpleShape.OBJECT_TYPE_OVAL); shape2.setLineStyleColor(102,101,10); shape2.setLineWidth(HSSFShape.LINEWIDTH_ONE_PT * 4); shape2.setLineStyle(HSSFShape.LINESTYLE_DOTSYS); FileOutputStream fileOut = new FileOutputStream("c:\\excel\\setLineStyleOfOval.xls"); hwb.write(fileOut); fileOut.close(); out.println("Your excel file has been generated"); } catch ( Exception ex ) { } %>