def METHOD_NAME(request):
    """Executes the named 'report' using the given 'query' and 'parameters' as POST parameters.
    Returns the result as a PDF.
    """
    check_permission_targets(request.specify_collection.id, request.specify_user.id, [ReportsPT.execute])
    if settings.REPORT_RUNNER_HOST == '':
        raise ReportException(_("Report service is not configured."))
    port = settings.REPORT_RUNNER_PORT
    if port == '': port = 80
    report_data = run_query(request.specify_collection, request.specify_user, request.POST['query'])
    if len(report_data['rows']) < 1:
        return HttpResponse(_("The report query returned no results."), content_type="text/plain")
    r = requests.post("http://%s:%s/report" %
                      (settings.REPORT_RUNNER_HOST, port),
                      data={'report': request.POST['report'],
                            'parameters': request.POST['parameters'],
                            'data': toJson(report_data)})
    if r.status_code == 200:
        return HttpResponse(r.content, content_type="application/pdf")
    else:
        raise ReportException(r.text)