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 a grid row when dataitem contains no data
chillertje
Hello,
i have a report with a grid. The grid contains 10 rows. Every row contains a dataitem. I'm trying to figure out how i can hide the row when the dataitem returns nothing.
I know how to hide table rows, and graphs but it look likes it doesn't work with a grid?
thnx for any help!
Find more posts tagged with
Comments
mwilliams
Hi chillertje,
What version of BIRT are you using? I did a quick check in 2.5.1 and was able to hide the grid row if the value was null in the data element. Can you set up an example with the sample database?
chillertje
Hi thnx for your help.
I'm now using the sample database, and i added a grid. I can hide a cell with the following expression: BirtComp.match(row["CITY"], "");
but when i set the visibility of a grid row to hide an element with the same expression, it doen't work.
can you confirm that i user the right expression? I found this expression on this forum, and it should hide a specific value, and not when there is no data returned
thnx for your help.
btw: when i use the example report with a table instead of a grid it works.
i'm using birt 2.5.1
mwilliams
chillertje,
Sorry, I meant for you to create an example of this not working with the sample database and attach it in here so I can see what you did. So, if you can attach your report that uses the sample database with a grid in here, that'd be great!
chillertje
sorry for my slow reaction. I was very busy with a lot of things.
I have modified a sample report, with a grid. The gridrow has an Melbourne as output, and it should not be visible, but it won't work. When i use a table it works perfect.
I have no idea how i can hide a row when there is no data, so i'm trying to hide a row when the the output is melbourne.
mwilliams
chillertje,
If you bind the grid to the dataSet, it works as expected. Let me know.
chillertje
hello,
thnx for your fast answer. within the sample report it works as aspected, but in my report it doens't work.
I think that my expression is wrong. I'm tryin to hide a row, when there is no data. My problem is that's the row is always hidden even i know there is data. When i disable the dataset parameter binding i can see data.
I have add my report as an attachment. I can't provide a sample database.
I hope that you could help me.
i really presuate your help!
chillertje
<blockquote class='ipsBlockquote' data-author="chillertje"><p>hello,<br />
<br />
thnx for your fast answer. within the sample report it works as aspected, but in my report it doens't work.<br />
<br />
I think that my expression is wrong. I'm tryin to hide a row, when there is no data. My problem is that's the row is always hidden even i know there is data. When i disable the dataset parameter binding i can see data.<br />
<br />
I have add my report as an attachment. I can't provide a sample database.<br />
I hope that you could help me.<br />
<br />
<br />
i really presuate your help!</p></blockquote>
<br />
It's something else.. when i disable all "Hide elements" i still get no data. I think that the problem is within my dataset binding.<br />
<br />
So when i don't set the dataset binding on the grid, i get data, and the visibilty doesn't work as aspected, when i set the dataset binding on the grid, i don't get data at all.
mwilliams
chillertje,
Can you explain what total.count() is counting for your visibility expression in your report? Another thing is with you using different dataSets in your report design. If you joined the two dataSets you're using with an outer join on host, you wouldn't need to bind the grid to a dataSet because the table it's in is already bound to the dataSet. If you want to keep it two dataSets for some reason, if you could try creating an example with the sample database that is more like your report, I could take a look at that. The new sample report would need multiple dataSets with the grid in the table like yours, with a similar visibility expression.
chillertje
Hello,
i can finally tell you what's going wrong.
Within the attachment you see a table and a grid.
The table contains ITEM1 databinding, and it just produces a list of productlines. I have set the visibility problem of that row so that it hides every value of "motorcycles" and this works perfect.
But, below the table i have set a grid. this grid had Item2, and it has a result of "Motor cycles". The row has a visibility property the same as the table, but it's not hiding.
the difference is that the table is bind to a dataset and the grid not. I have just bind the dataitem to the dataset. I'm using this way in my own report.
can you tell my why the grid is not hiding the row?
thnx for your help.
mwilliams
chillertje,
To hide the row of the grid with an expression like that, you'll have to bind the grid to the dataSet. I don't think there'll be another way to do it.
chillertje
<blockquote class='ipsBlockquote' data-author="mwilliams"><p>chillertje,<br />
<br />
To hide the row of the grid with an expression like that, you'll have to bind the grid to the dataSet. I don't think there'll be another way to do it.</p></blockquote>
<br />
<br />
Thnx for your help. i'm going to try this
Cheong Hoong Jun
<p>Hi mwillians,</p>
<p> </p>
<p>My report has the following:</p>
<p>1. Dataset Manager</p>
<p>2. Dataset Employee</p>
<p>3. List --> bind to dataset Manager</p>
<p>4. Table (inside a grid) --> bind to dataset Employee</p>
<p> </p>
<p>I would like to hide the grid when my table employee has no value.</p>
<p> </p>
<p>When i bind the grid to the dataset Employee, it will have error in the datarow from dataset Manager. </p>
<p> </p>
<p>Would you mind to enlighten me on the above issue?</p>
<p> </p>
<p>Thanks</p>