I need to create a report of the selected month with the information contained in the database, so I want to create a variable in iReport that receives the month (by netbens) which will be compared to the existing sqll in Ireport that is connected directly with the database .
Metrodo iReport:
public void imprimir() {
try {
JasperPrint print = JasperFillManager.fillReport("C:\Users\costa\OneDrive\Documentos\NetBeansProjects\Relatorio\Estoque.jasper", null, conexao);
JasperViewer.viewReport(print, false);
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e);
}
}
SQL present in iReport:
select * from Hospede h where DATE_FORMAT(h.horaini,'%m') = variavel