Normally we generate report by IReports based on query to the database, but now I come across the following question, I will assemble a report based on the data shown in the client's visual, in case it is redundant to fetch the information back into the database.
I made a simple test by passing 1 information via parameter and trying to generate a view.
But it did not generate any page, I believe it is something simple but I am not able to generate this output.
In the report I only have one parameter created and added in the detail field in it.
And that's how I call it.
public void ImpressaoRelatorio() {
InputStream inputStream = getClass().getResourceAsStream("RelatorioParametro.jasper");
Map<String, Object> parametros = new HashMap<String, Object>();
parametros.put("descProduto", "Produto Teste");
try {
ReportUtils.openReport("Relatorio Produto teste", inputStream, parametros,
ConnectionFactory.getAgilConnection());
} catch (SQLException exc) {
exc.printStackTrace();
} catch (JRException exc) {
exc.printStackTrace();
}
}
But running it returns blank.