jasper reports - How To EXPRESSION with WHERE " count Orders WHERE customer = Mr. Smith "? -


i beginner in ireport , cant program java hope can give me idea.

i've managed make chart displays how all customers have ordered in february, march,... etc.

thats how did it:

in category expression have: $f{month}

in value expression have : $f{count(orders)}

but want display how only 1 customer (for example customer a) has ordered in february, march,... etc.

i have following values can use:
month, orders , customers(here customer names saved)

-------//-----------update--------------//-----------------------------------

i want display chart represents total orders per month of customer. iam trying display 3 customers (my database has 3) in 1 chart (stacked).

for example(see picture above): want display total orders customer (yellow) in february. , want display total orders customer b (blue) in february , same customer c.

the customers should displayed stacked (3 in every month) , every customer should have different color plus total orders every customer should displayed ...like in picture above example: customer a(yellow) made 3 total orders in february, customer b(blue) made 2 total orders in february, customer c..etc.

it important every month displays 3 customers...stacked.

how do this?

i appreciate every idea.

from have understood question, want show chart represents total orders per month of customer. need not use stacked bar graph purpose. may want use bar graph serve purpose. if want see chart per customer, create 1 parameter $p{customer} , pass query.

refer document ireport-ultimate-guide-3 on how create parameters , use in queries.

e.g:

select customer,month,count(orders)  <your table>  customer=$p{customer}  group month 

the above approach work if want see details 1 customer.

**here solution after update.** 

from update, seems want represent total orders per month customers.and want use stacked chart same.

then have done correct have missed add field 'series expression'

add field customer series expression , resolve problem i.e,

series expression : $f{customer} category expression : $f{month} value expression  : $f{count(orders)} 

this display chart in format have specified.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -