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

Dynamic value change for static label column header


rathi

Recommended Posts

Hi,

I have a column header that is a part of the table element. And this table and its dataset are not a part of the main data set. I want to the column header to change dynamically based on values in the main dataset. The main dataset and sub data set return different resultsets

The steps I followed were,

1. For the dataset in main dataset, I created a variable (v1) to hold the value of a particular column. (The main dataset returns only one row)

2. I create a parameter p1, in sub dataset and get it the value of variable v1. 

3. Then I assign p1 to the static label of column header (of sub data set) in the "print when expression".

Also, I want the same column to appear dynamically which I achieved.

What I am unabe to achieve is that dynamic display of static label column header along with hide/show functionality

Any help on this would be greatly appreciated

Thanks in advance

Rathi

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi,

The following steps were followed

1. create a variable called v1_enabed (string) and v1_display(string) in the main dataset. I also assigned the required fields(from the main data set) to these variables 

2. I created a parameter p1(string) in subdataset

3. I use the subdataset fields for table creation. I used the table element.

4. I go the table and map the parameter p1(string) to the table. And I assign the expression ($V{v1_enabled} == Character.toString('1'))  ? $V{v1_display} :  $V{v1_display} to it

Until here whenever I run the report, I do not get any error.

5. Now, I go the table. Pick up the 5th column and assign this in the print when expression section -- $P(p1)

Now, comes the error,  java.lang.String cannot be cast to java.lang.Boolean

How do I solve this?

Thanks in advance

Rathi

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