Boa Noite!
Estou precisando de ajuda!
Estou fazendo um relatório que é passado parametros.
no meu Controller esta assim:
@Get @Path("/aluno/relatorioAlunosNome/${aluno.nome}")
public Download relatorioAlunosNome(String nome) throws JRException, SQLException, ClassNotFoundException {
InputStreamDownload relatorio = dao.relAlunosNome(nome);
return relatorio;
}
no meu DAO esta assim:
public InputStreamDownload relAlunosNome(String nome) throws JRException, SQLException, ClassNotFoundException {
InputStream file = getClass().getClassLoader().getResourceAsStream("/br/com/catequese/relatorio/relAlunosNome.jasper");
Map parametros = new HashMap();
parametros.put("nomeAluno", nome);
//parametros.put("codigo", "6503000");
ByteArrayOutputStream os = new ByteArrayOutputStream();
JasperRunManager.runReportToPdfStream(file, os, parametros, getConexao());
InputStream document = new ByteArrayInputStream(os.toByteArray());
return new InputStreamDownload(document, "application/pdf", "relatorioAlunosNome.pdf", true, os.toByteArray().length);
}
no meu jsp esta assim:
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<form id="formulario" action="<c:url value="/aluno/relatorioAlunosNome/${aluno.nome}"/>" method="POST">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td><input name="aluno.nome" type="text" id="aluno.nome"></td>
</tr>
<tr>
<td><button type="submit">Enviar</button></td>
</tr>
</table>
</form>
</body>
</html>
no meu select do ireport esta assim:
SELECT
paroquia.`nome` AS paroquia_nome,
aluno.`nome` AS aluno_nome,
aluno.`cidade` AS aluno_cidade,
aluno.`foneComercial` AS aluno_foneComercial,
aluno.`foneResidencial` AS aluno_foneResidencial,
aluno.`foneCelular` AS aluno_foneCelular
FROM
`paroquia` paroquia INNER JOIN `aluno` aluno ON paroquia.`id` = aluno.`paroquia`
WHERE
aluno.`nome` = $P{nomeAluno}
ORDER BY
aluno.`nome` ASC
lembrando que no ireport eu testo e funciona passou o parametro e tal oq percebi é que o parametro não vai ao metodo oq estou fazendo de errado???
Agradeço a ajuda