title: How can I download report file from using a button on odoo website page?
body: <p>I need to download a odoo report using a button on <strong>odoo website page</strong>.
  what I did is:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;a class="btn btn-primary hidden-print cms-print-pdf" t-att-href="'/cms/report/print?id='+str(main_object.id)"&gt;
                              &lt;span&gt;&lt;i class="fa fa-print" aria-hidden="true"&gt;&lt;/i&gt;
                              &lt;!--&lt;input type="hidden" id="cms_page_id" t-att-value="main_object.id"/&gt;--&gt;
                              &lt;/span&gt;
                              Print&lt;/a&gt;
  </code></pre>
  
  <p>In my controller</p>
  
  <pre class="lang-py prettyprint-override"><code>@http.route(['/cms/report/print'], type='http', auth="public", website=True)
  def print_saleorder(self, **kw):
      cr, uid, context = request.cr, SUPERUSER_ID, request.context
      sale_order_id = request.session.get('sale_last_order_id')
      if 2:
          pdf = request.registry['report'].get_pdf(cr, uid, [2], 'x.cms_html_body', data=None,
                                                   context=context)
          pdfhttpheaders = [('Content-Type', 'application/pdf'), ('Content-Length', len(pdf))]
  
          return request.make_response(pdf, headers=pdfhttpheaders)
  </code></pre>
  
  <p>But unfortunately I only get the output a webpage preview , But I need to make a download response directly. What SHOULD I NEED TO DO?</p>