Jump to content

use java variable variable values in ireports


asifvkd

Recommended Posts

How can i filter a query while designing reports using ireport with a varialbe value retrieved from java program.

Eg: select EmpName from Employee where EmpId="111";

 

In the above eg: value 111 is a string/int value from java program.

 

Or how can I execute a query for particular userid which is generated after login with user name and password?

 

Thanks,

Asif K

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

you can set up a parameter in your report. Pass the value from your java program something like this

--

parameters.put("EmpID", empID);

--

Make sure that you have the same parameter name defined in the report as you would in the java program. Then use this parameter in your report query

--

select * from employees where empid=$P{EmpID}

Link to comment
Share on other sites

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...