-1

I am a newbee to jasper reports..My question.

Can we dynamically change a dataset query that is used for a table entity ,

if we can , please tell me how

bharath
  • 3
  • 3

1 Answers1

0

Yep we can .

Say you define 3 queries

q1 , q2 , q3

and a condition say cond1 which will determine which query will be used

Now, you can take a parameter say $P{param1} and set its default value expression as

If cond1 is true then set q1 else set q2

So , basically your param1 will be containing exact query which you will be executing

Now, Open query edition use param1 as a placeeholder ie whatever be the content of param1 , they will be executed as such .

Type like this

P!{PARAM1}

and preview .

This should do.

Regards, Ankush

Ankush Chhabra
  • 166
  • 2
  • 11
  • Thanks for the reply Ankush, basically my problem is i have a table in my master report , while creating table i passed a query to get all the values from a database table, now in the java class i want to change the query so that i get the values based on where clause... – bharath Jul 10 '13 at 07:03