Report in IREPORT - STATUS

Asked

Viewed 74 times

-3

Good morning , I need to change a report in IREPORT that works today as well:

Currently the field works like this:

    (Boolean)
    $F{documentoVigente} ? "VIGENTE" : "VENCIDO"

I have a text called $F{documentVigent} passing an Expression class (java String)

I need my report to be generated like this today:

        if $F{dataVencimento} = $F{CurrentDate} : "VIGENTE"
        if else $F{dataVencimento} < $F{CurrentDate} : "VENCIDO"
        else : "VENCENDO" > a data do dia 

I have a class that references this report:

public  class  RepDtoReport  implement Serizable {

private String nomeRepresentante;
private Integer cartaoAssinatura;
private String descricaoGrupo;
private String codigoPessoa;
private String descricaoCargo;
private String descricaoDocumento;
private Date dataAtualizacao;

private  Date   dataVencimento;

private boolean documentoVigente;


}getts e setters}

public boolean is documentoVigente() {
return documentoVigente;
}

public void setDocumentoVigente (final boolean documentoVigente){
this.documentoVigente = documentoVigente;
}

public  Date getDataVencimento() {
return dataVencimento;
}

public void setDocumentoVigente (final Date dataVencimento ){
this.dataVencimento = dataVencimento;
}

Today he’s like this: Relatorio

I can only do it in the ireport ?

  • This is the best way to make this kind of comparison, I believe your field documentVigent is coming with a false or null value. He’s the Boolean type, right?

  • He is the type Boolean, in case I needed to put another value as it would be?

  • ai vc does the nested tender operation, example $F{myCondication1} ? " myresult" : $F{myCondication2} ? " my_results2" : "my_other_results2"

  • Okay, I have a Boolean condition and I need that same field to be adding the value On day for example, create one more as Boolean? and he will compare the 3 and bring the one I need?

1 answer

0

I have a practice that I love to use. In reporting, I like to separate data processing for the database and IO for the application. Thinking in this sense, when you make a query in the database and bring an N of records, when offering it to the application layer the same need to iterate in each of the records to apply the rule.

Example: A query that returns 100 records ends up processing these same 100 to get the desired result applying the rules of the report.

My tip for you is to analyze the feasibility of using a VIEW already with all the necessary rules for your report. Obviously, App rules have their burdens and bonuses, but there is a huge gain in processing that can be an advantage, not to mention the ease of implementing in any Report tool.

  • I understand this logic but unfortunately it is already an application in production and I can not change some packages.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.