title: GWT: Sending PDF document from server to client
body: <p>I have an RPC service and one of the method is generating a report using Pentaho Reporting Engine. Report is an PDF file. What I'd like to do, is when user request a report, the report is sent back to him and save dialog or sth pops up. I tried this inside my service method:</p>
  
  <pre><code>Resource res = manager.createDirectly(new URL(reportUrl), MasterReport.class);
              MasterReport report = (MasterReport) res.getResource();
              report.getParameterValues().put("journalName", "FooBar");
              this.getThreadLocalResponse().setContentType("application/pdf");
              PdfReportUtil.createPDF(report, this.getThreadLocalResponse().getOutputStream());
  </code></pre>
  
  <p>But it doesn't work. How it can be done?</p>