title: Save file dialog box, when creating excel file in java using extjs
body: <p>I am using extjs 4.1 and spring mvc 3. I am passing some values from extjs form to the spring controller and then int java side I am creating an excel sheet with the data that I get from DB.
  My problem is that I am not able to get the save file dialog box when the excel gets created. I have written this piece of code also</p>
  
  <pre><code>String filename="tradeReport.xlsx";
  res.setHeader("Content-Type", "application/vnd.ms-excel");
  res.setHeader("Content-Disposition", "attachment; filename=\"" + filename + "\"");
  </code></pre>
  
  <p>Excel sheet creating code:</p>
  
  <pre><code>try {
      OutputStream outs=res.getOutputStream();
      //FileOutputStream fout=new FileOutputStream(new File("c:/data/tradereport.xls"));
      workbook.write(outs);
      //outs.flush();
      outs.close();
      System.out.println("File created!");
  } catch (Exception e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>This function I am writting in DAO class.</p>
  
  <p>Note:-Excel is being created successfully when using</p>
  
  <p><code>FileOutputStream fout=new FileOutputStream(new File("c:/data/tradereport.xls"));</code></p>
  
  <p>Please help me with a solution.Thanks</p>