0
How do I create a way to print a DB report. Follow my method below.
public void printReport (Date initialDate, Date endDate){
list<Sale> sales = getSales (initialDate, endDate);
for (Sale s:sales){
Store st = s.getStore(); // Recura a Loja
CreditCard cc = s.getCreditCard(); // Recupera o Cartão
System.out.println(st.getNome() + ";" + cc.getName() + s.getValue());
}
}
Print on which Ireport ? What kind of report Is it? Web application or DESKTOP ?
– LR10
take the community tour: https://answall.com/tour and mark the other questions you have already asked as answered
– Rovann Linhalis
It is a simple print, run the database query, without using frameworks. It is in DESKTOP. Here is a statement: -- Build a code to print the report. Consider that the Sale, Creditcard and Store templates contain the attributes and relationships that represent the columns of the tables. The code will receive as parameter the dates for generating the report. 
Considere também que já existe o método getSales(initialDate, endDate), que irá executar
a query elaborada na questão 1.
public void printReport(Date initialDate, Date endDate) {
List<Sale> sales = getSales(initialDate, endDate);
...
}
– Lucas Esbegue
Your method is ok, what’s your doubt ?
– LR10
My question is if I need to put this in a DAO class. But from the statement I think not, are just asking the same method. o/
– Lucas Esbegue