Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Hide table
Arco
Hi there,
In my report design I want to hide a table depending on an attribute from another dataset than the table is based on.
Can anyone tell me how to do this?
Thanks in advance,
Arco
Find more posts tagged with
Comments
thuston
Is one nested inside the other?
Which comes first?
You can probably just script and place the attribute in a global variable, then use that for the second Table's visibility expression.
Arco
I new to BIRT so can you help me a bit more.
The thing is I have one table and I have to hide it depending on a the value of a field from another dataset which only contains one record.
When using the expression builder of the hide property I'm able to choose fields from the column bindings only and not from my other dataset.
So the question is how to use a field from another dataset in the expression builder than the ones available from the column bindings.
Thanks in advance,
Arco
thuston
Create a Table or Grid that is bound to the single value dataSet.
Then place the Show/Hide Table inside this one.
You can either have the outer object do the hiding, or you can use row._outer["Col_Name"] from the inner Table to see the outer value.
mwilliams
Arco,
Here's a simple example. The single value from the second dataSet is 1. In the visibility statement for the inner table that's attached to the first dataSet, it's checking for 2, so it doesn't hide the table. If you change the visibility statement to check the outer value for 1, it will hide the inner table.
Hope this helps. Let us know if you have questions.
Design made in 2.6.0
Arco
Thanks for the answers, some little questions left.
What if I have several other elements on the same report which need to be hidden on the same condition.
If I place tables around them to do the hiding trick will the other dataset be read over and over again or will it just be read once ?
The last question is I read somewhere it's better to drop the table instead of hiding it, because when hiding the query bound to the table will be executed while the result isn't displayed.
If this is a better solution can someone give me an example how to do this.
Thanks in advance,
Arco
mwilliams
Arco,
I believe that the caching in BIRT should catch that the data has already been pulled and only run it once. You could do some simple logging to figure that out. Dropping might not be possible since you want to know a value in the dataSet. If you were dropping based on a parameter or something like that, you definitely could, but I don't know if you'd have the data in time to know to drop the table/element.
kkan
Hi Micheal,
I need your help!!
my report is using XMl as a datasource.. the way data is to be printed can vary .. ok let me try explain as best as i can..
I have created 2 datasets one is orderitems (this is essentially a collection of items)
and other is WorkcodeRow - this holds single information not rows of information..comprimisong of a description and an value
Both information will be displayed in same grid/tabel but not at same time..basically orderitems element in xml only will display stuff if rows of information from the application that generated the XML has been added..otherwise info comes from WorkcodeRow which will return an description and value..
so if orderitems is null then show description and value from Workcoderow cos thats where info will be found.. but in birt I don't knwo how to do this as in how do i read from one dataset when grid/table linked to another... I did try to create a dataset which is a composite of both datasets but orderitems then doesnt show any data..
HELP!! Am very new to BIRt so will really need some examples
Thanks in advance
p.s I've attahced all images for shared resource plus PDF sample of what output should look like thanks again
kkan
Hi Micheal,
I need your help!!
my report is using XMl as a datasource.. the way data is to be printed can vary .. ok let me try explain as best as i can..
I have created 2 datasets one is orderitems (this is essentially a collection of items)
and other is WorkcodeRow - this holds single information not rows of information..comprimisong of a description and an value
Both information will be displayed in same grid/tabel but not at same time..basically orderitems element in xml only will display stuff if rows of information from the application that generated the XML has been added..otherwise info comes from WorkcodeRow which will return an description and value..
so if orderitems is null then show description and value from Workcoderow cos thats where info will be found.. but in birt I don't knwo how to do this as in how do i read from one dataset when grid/table linked to another... I did try to create a dataset which is a composite of both datasets but orderitems then doesnt show any data..
HELP!! Am very new to BIRt so will really need some examples
Thanks in advance
p.s I've attahced all images for shared resource plus PDF sample of what output should look like thanks again
mwilliams
From the sounds of it, one thing you could do is in the initialize method, you could put ordersDScheck = 0;. Then, in the onFetch of the orders dataSet, you'd put ordersDScheck = 1; After the table tied to the orders dataSet in your report, you'd put a grid that displays the info from WorkcodeRow. Now, you'd use the variable ordersDScheck in your visibility expressions for the table and your WorkcodeRow grid you created to determine which to show when the variable comes back either 0 or 1. Hope this makes sense.
kkan
Hi,
Thanks for the reply.. I understand the bit about setting ordersDSCheck as a flag but am a bit confused how i would add the grid inside the table..is tht right..? also would the columns appear as they should
thanks Kiran
mwilliams
Maybe I got confused on the description. I understood that if the orderitems dataset was empty, you wanted to display the workcoderow info instead. If this is not correct, can you explain it again with some sample data so that I understand?
kkan
No that is correct if orderItems is is empty then use workcodeRow I just need more clarification on the explanation on the second bit of what you sed i.e.
"After the table tied to the orders dataSet in your report, you'd put a grid that displays the info from WorkcodeRow. Now, you'd use the variable ordersDScheck in your visibility expressions for the table and your WorkcodeRow grid you created to determine which to show when the variable comes back either 0 or 1. Hope this makes sense."
dont really understand... :unsure:
mwilliams
Here's a simple example of what I meant. Run this report and enter 140000 as the parameter value. Then, re-run the report and use 240000 as the parameter value.
Mikisan
the solution is great, works perfect, I am wondering if there is such thing like row._inner ?? or a way to reference a value of a sub table in a container table?
mwilliams
To my knowledge, there is not such a thing. The order in which the tables are created and when you have access to the data would limit this, I believe. There would be no "inner" data at the time that you're trying to check it, so it would fail.
What are you trying to do, maybe I can help in another way?