title: how to draw a circle shape in excel by using apache POI
body: <p>I like to draw the circle shape in excel by using apache POI. i have following code. there is not error when i run this code. but when i open the outputted excel file, it say "File error: data may have been lost" and there is not circle shape in outputted excel file.</p>
  
  <pre><code>        // Get template file path.
          FileInputStream in = new FileInputStream("C:\template.xls");
  
          // Create work book.
          Workbook wb = WorkbookFactory.create(in);
  
          sheet = wb.getSheetAt(0);
  
  
          // Draw the circle shape.
          HSSFPatriarch patriarch = (HSSFPatriarch) sheet.createDrawingPatriarch();
          HSSFClientAnchor a = new HSSFClientAnchor(1023, 255, 1023, 255, (short)  7,  10, (short) 7, 10);
          HSSFSimpleShape shape1 = patriarch.createSimpleShape(a);
          shape1.setShapeType(HSSFSimpleShape.OBJECT_TYPE_OVAL);
          shape1.setNoFill(true);
  
          FileOutputStream out = new FileOutputStream("C:\output.xls");
          wb.write(out);
          out.close();
  </code></pre>
  
  <p>PS: the excel template file ("C:\template.xls") have other figure (shape) already.</p>
  
  <p>thanks</p>