I'm trying to pass the Id parameter to a query in the Jasper Report. The parameter is being passed, but I'm getting conversion error from the
Conversion error:
There was an unexpected error (type=Internal Server Error, status=500).
java.lang.String cannot be cast to java.lang.Long
My HTML (index.html)
<div class="six columns">
<label for="id">Seu Id</label>
<input class="u-full-width" type="text" placeholder="Id do Livro" id="id" name="id">
</div>
My Query (books.jrxml)
<parameter name="nome" class="java.lang.String"/>
<parameter name="cabecalho" class="java.lang.String"/>
<parameter name="assinatura" class="java.lang.String"/>
<parameter name="id" class="java.lang.Long" nestedType=""/>
<queryString language="SQL">
<![CDATA[select id_livro, titulo, autor from livro where id_livro = "$P{id}"]]>
</queryString>
<field name="id_livro" class="java.lang.Long"/>
<field name="titulo" class="java.lang.String"/>
<field name="autor" class="java.lang.String"/>