title: How to export to Excel from Spring MVC
body: <p>I want to export some data which I have retrieved from the database to the controller level. From the controller I need to export this data to an Excel file without using a view.</p>
  
  <p>I wrote:</p>
  
  <pre><code>        ReportSearchVO searchL = formL.getObjReportSearchG();
  
          loggerG.info("Resource List:" + searchL.getResourceListG());
  
          projDetailReportL = reportServiceG.createProjectDetailReport(formL);
  
          formL.setProjDetailReport(projDetailReportL);
          formL.setReportTypeEnum(ReportTypeEnum.PROJECTDETAILREPORT);
          formL.setObjReportSearchG(searchL);
  
          requestR.setAttribute("resLevelForm", formL);
          returnModelAndView = new ModelAndView(
              ViewConstants.FINAL_VIEW_PROJECT_DETAILS_REPORT, "reportForm",
              formL);
  </code></pre>
  
  <p>but this uses a view.</p>