title: How to set a name for the Jasper report download?
body: <p>I have declared a bean in jasper-view.xml as follows</p>
  
  <pre><code>&lt;bean id="resultsPdf"
        class="org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView"
        p:url="classpath:reports/resultsPdfFormat.jrxml"
        p:reportDataKey="datasource"&gt;
      &lt;property name="headers"&gt;
          &lt;props&gt;
              &lt;prop key="Content-Disposition"&gt;
                  attachment; filename=results.pdf
              &lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>The method in the controller is as follows</p>
  
  <pre><code>@RequestMapping(value = "/results-pdf", method = RequestMethod.GET)
  @ResponseBody
  public ModelAndView generateResultsPdf(@RequestParam("year") String year) {
  
      List&lt;Student&gt; studentList = studentService.getResultsByYear(year);
      JRDataSource jrDataSource = new JRBeanCollectionDataSource(studentList);
      Map&lt;String, Object&gt; parameterMap = new HashMap&lt;&gt;();
      parameterMap.put("title", "Results table"));
      parameterMap.put("datasource", jrDataSource);
  
      return new ModelAndView("resultsPdf", parameterMap);
  }
  </code></pre>
  
  <p>At the moment it is working fine. The name of the downloaded file is </p>
  
  <blockquote>
    <p>results.pdf</p>
  </blockquote>
  
  <p>Now I would like to append the year parameter to the file name so that it would read as </p>
  
  <blockquote>
    <p>results_YEAR.pdf</p>
  </blockquote>
  
  <p>Any ideas? Thanks in advance.</p>