title: How to print report from website in odoo11?
body: <p>I want to print report by clicking on print button on website.</p>
  
  <p>But it shows some error:</p>
  
  <blockquote>
    <p>File "/home/priya/workspace/ODOO11/odoo-11.0/odoo/http.py", line 829, in dispatch
        r = self._call_function(**self.params)
      File "/home/priya/workspace/ODOO11/odoo-11.0/odoo/http.py", line 342, in _call_function
        return checked_call(self.db, *args, **kwargs)
      File "/home/priya/workspace/ODOO11/odoo-11.0/odoo/service/model.py", line 97, in wrapper
        return f(dbname, *args, **kwargs)
      File "/home/priya/workspace/ODOO11/odoo-11.0/odoo/http.py", line 335, in checked_call
        result = self.endpoint(*a, **kw)
      File "/home/priya/workspace/ODOO11/odoo-11.0/odoo/http.py", line 936, in <strong>call</strong>
        return self.method(*args, **kw)
      File "/home/priya/workspace/ODOO11/odoo-11.0/odoo/http.py", line 515, in response_wrap
        response = f(*args, **kw)
      File "/home/priya/repo/rp-group/rpg_quotation/controllers/web_page.py", line 1442, in update_quotation
        res = self.print_quotation_software_report(data, int(quotation_id))
      File "/home/priya/repo/rp-group/rpg_quotation/controllers/web_page.py", line 2699, in print_quotation_software_report
        pdf = request.env.ref('rpg_quotation.rpg_quotation_software_setwise__report').report_action(self, data=data, config=False)
      File "/home/priya/workspace/ODOO11/odoo-11.0/odoo/addons/base/ir/ir_actions_report.py", line 703, in report_action
        context = dict(self.env.context, active_ids=active_ids)</p>
  </blockquote>
  
  <pre><code>UnboundLocalError: local variable 'active_ids' referenced before assignment
  </code></pre>
  
  <p>My js code:</p>
  
  <pre class="lang-js prettyprint-override"><code>$(document).on('click', Quotation.elements.print_quotation_software_selector, function() {
   var self = $(this);
   var data = {
     'xpath': null,
     'cmd': 'print_quotation_software_report'
   };
   Quotation.methods.xhr(data, function(r) {
   });
  
  });
  </code></pre>
  
  <p>My Python code:</p>
  
  <pre class="lang-py prettyprint-override"><code>def print_quotation_software_report(self,data,quotation_id):
   order_id = quotation_id
   if quotation_id:
     pdf = request.env.ref('rpg_quotation.rpg_quotation_software_setwise__report').report_action(self, data=data, config=False)
     pdfhttpheaders = [('Content-Type', 'application/pdf'), ('Content-Length', len(pdf))]
     return request.make_response(pdf, headers=pdfhttpheaders)
  </code></pre>
  
  <p>Here,</p>
  
  <p><code>rpg_quotation</code> is the module name and <code>rpg_quotation_software_setwise__report</code> is report id.</p>