para mandar el reporte al cliente lo ahces asi:
Código:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
ServletOutputStream servletOutputStream = response.getOutputStream();
InputStream reportStream = getServletConfig().getServletContext().getResourceAsStream("/reports/FirstReport.jasper");
try
{
JasperRunManager.runReportToPdfStream(reportStream,
servletOutputStream, new HashMap(), new JREmptyDataSource());
response.setContentType("application/pdf");
servletOutputStream.flush();
servletOutputStream.close();
}
catch (JRException e)
{
// display stack trace in the browser
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter(stringWriter);
e.printStackTrace(printWriter);
response.setContentType("text/plain");
response.getOutputStream().print(stringWriter.toString());
}
}