Jump to content
We've recently updated our Privacy Statement, available here ×

Adding in ireport


Recommended Posts

By: Adriana Mestrinelli Paranhos - jasperdri

Adding in ireport

2002-11-27 05:37

Necessary to make an addition with dirferentes table data, as I use "sum" of the data base in jasper?

 

 

By: Giulio Toffoli - gt78

RE: Adding in ireport

2002-11-27 05:40

I don't understand your needs. Colud you formulate an example?

Thanks

 

Giulio

 

 

By: Adriana Mestrinelli Paranhos - jasperdri

RE: Adding in ireport

2002-11-27 08:31

How can I make a sum in Jasper?

Because when i make a select.

ex:

 

SELECT cliente.str_cli_nome, sistema.str_sis_nome, lote.str_lot_descricao,

programa.int_prog_chprog_pk, programa.str_prog_nome,

programa.int_prog_totalhorasprevisto,

profissional.str_prof_nome,

estagio.str_est_nome, fase.str_fas_nome,sum(desenvprog.int_desenvprog_totalhoras), sum(programa.int_prog_totalhoras)

FROM cliente,

projeto,

sistema,

lote,

programa,

profissional,

desenvprog,

estfas,

estagio,

fase

 

And I try to make that sum:

 

sum (table.field) and i put in a jasper, it doesn t work...

 

why????

 

does Jasper has any method that makes it?

 

thanks

 

Adriana

 

 

 

By: Giulio Toffoli - gt78

RE: Adding in ireport

2002-11-28 00:15

Ah, ok, I have understand.

 

1) You must create a new variable. You can name this variable i.e. "MySum".

2) Set calculation type "sum".

3) Set your preferren reset type (i.e. Report to have total sum)

4) Set variable type to the type of data you want sum (for example java.util.Double)

5) Write in Expression field the field that you want calculate sum (i.e. $F{programa.int_prog_totalhorasprevisto})

6) Create a textfield element and set as fieldExpression: $V{MySum} with the appropriate class value.

 

Good look

Giulio

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...