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)
How to display Message When there is no data from data set to display in crossTab
vbolisetti
Hi,
I am using Crosstab to display the Pivot result. it was working for me. But i have couple of doubts.
1) i want to display a message like "there is no Data" when there is no data coming from data set.
2) i have result set that displays the data month wise. here i had problem that when there is no data for sepecfic month it is skiping that month. say jan,feb,May like that. how can i resolve this problem. Ihave tried to use show emprty columns. but i was not displaying it corectly. I have attached the Image for this problem.
Can some one help me. I am using Birt 2.3 version.
Thank you in advacne
Vijay Kumar Bolsetti.
Find more posts tagged with
Comments
mwilliams
See this post in the devShare. There is an example showing how to show a "No Data" label when the query returns no data.
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1346-eclipsecon-2011-hands-on-tips-from-the-birt-forums-examples/
As for the second question, you can create a scripted or flat file dataSet that has a value from each month and join it to your actual dataSet. This will force the extra columns to be in the crosstab.
Let me know if you have questions.
vbolisetti
Thank you williams,
I was expecting reply from you only(almost all posts are answerd by u alone).It was very helpful for me.
Coming to the second point i am having the problem only when there is no data for that particular month.so how do i know that which month is not having data.i think i need to write some logic if there is any gap between from month to To month. is this is correct way?
Thank you
Vijay Kumar Bolisetti
vbolisetti
Hi Williams,
I am not able to run your example. I am using MyEclipse 7.5 version to create the design files and i guess u are using Eclipse Ide.I tried to change the version="3.2.22" to my local "3.2.17" in design file what i have downloaded but getting the error saying that error in XML Source page.
I think you are using eclipse Ide. What is the version? With that version can i create a report Web application (Option available in MyEclipse- just create Report Web Project generate the war file and place that in application server to integrate with other application). This kind of facility is available in eclipse version.
Can u answer my silly doubts?
Thank you
mwilliams
I actually made those in Actuate BIRT 11, which should work out to be BIRT 2.6.0.
The idea to be able to hide a report element if there is no data would be to initialize a variable in your initialize method, i.e. i=0. Then, in your onFetch of your dataSet, change this variable's value, i.e. i++ or i=1 etc. Then, in your visibility statement for your report element, you'd just check this value.
if (i == 0){
true; // hides the element because the onFetch was never called meaning there is no data.
}
else{
false; //shows the element because the variable i was changed meaning there is data
}
This is for hiding an entire element though. Not for what it seems you're wanting, it seems. So, you're wanting to show the columns in a crosstab that don't have data but just have a label that says, no data for this month? Is this correct? Or are these two completely separate issues?
Like I said before, forcing a month to show is as easy as creating a simple scripted dataSet that has the first day of each month in it, join it with the actual dataSet and use a couple computed columns to sort out your data so it will work correctly with the dataCube and your empty months should show up. Let me know if you'd like an example!
vbolisetti
thank you for your response,
I am able to Display message for whole report when there is no data. i followed your link explaining how to do that in one of the posts.i have taken one label and binded that with cross tab row data.
It will be very helpfull to me if u can proved example but ur example is not working with me. i think Actuate BIRT 11 is paid version. so i can run ur example in my machine.
Thank you
mwilliams
I have other versions too! I'll make one in your version.
mwilliams
Take a look at this. The first crosstab uses the regular dataSet. The second uses the joint dataSet between my scripted dataSet and the regular dataSet. The the report outline view to see where I used script. I also added computed columns in the joint dataSet.
Hope this helps.
vbolisetti
HI Williams,
can u share the data set and scrpted data set. i will run through them local.I am using MYSql 5.0 databse.
thank you
VIjay
mwilliams
Not sure I'm understanding your question? The scripted dataSet and dataSet are part of the report I attached above. You should be able to open that report in BIRT 2.3.2 and see them.