Jump to content

parameter query


mhbashar1

Recommended Posts

I have the following query in my master report-

 

SELECT purchase_item,purchase_date

FROM purchase

Where MONTH(purchase_date)=$P{month} AND YEAR(purchase_date)=$P{year}

 

where $P{month}and $P{year} is parameter for month and year respectively.Now how should I provide this month and year from my java application with Map collection.Can I do the following-

Code:

static HashMap <String,String> map=new HashMap<String,String>();
map.put("month",12);
map.put("year",2008);
JasperFillManager.fillReport(reportFile, map, jdbcConnection);
Link to comment
Share on other sites

  • Replies 1
  • 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...