Home
Analytics
display no data found when the csv file is blank
srikala
Hi Williams
How can i display a no data msg in the report, when the csv file that you are binding doesnt have any data.not even the col headers , its just a blank csv.
Regards
srikala.
Find more posts tagged with
Comments
johnw
http://digiassn.blogspot.com/2007/03/birt-hide-report-table-when-no-data-is.html
The above is a tutorial on how to display a message when no data is returned.
mwilliams
Take a look at the attached report. If you run the report with the provided CSV file, everything works correctly, as you'd expect. I put script in the initialize method that reads in the file contents and I display the variable I store it in in the report, so you'll see the table and then the results of reading in the file using script.
If you were to delete all the contents of the CSV, so that there aren't even headers, the script that reads in the file contents will catch this and drop your table so that BIRT doesn't try to access the CSV and give you the error. A persistent global variable is also set that I use to decide to display the "no data" text box or not.
Hope this helps. Obviously, if your flat file is very large, reading in the entire file would be a waste, so if your file is normally large, I'd just read in a couple lines to be sure it's not empty.
Let me know if you have questions.
srikala
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="97406" data-time="1331147399" data-date="07 March 2012 - 12:09 PM"><p>
Take a look at the attached report. If you run the report with the provided CSV file, everything works correctly, as you'd expect. I put script in the initialize method that reads in the file contents and I display the variable I store it in in the report, so you'll see the table and then the results of reading in the file using script.<br />
<br />
If you were to delete all the contents of the CSV, so that there aren't even headers, the script that reads in the file contents will catch this and drop your table so that BIRT doesn't try to access the CSV and give you the error. A persistent global variable is also set that I use to decide to display the "no data" text box or not.<br />
<br />
Hope this helps. Obviously, if your flat file is very large, reading in the entire file would be a waste, so if your file is normally large, I'd just read in a couple lines to be sure it's not empty.<br />
<br />
Let me know if you have questions.<br /></p></blockquote>
<br />
<br />
<br />
You are wonderful. Great its working for us.<br />
Thanks a ton for your help.<br />
<br />
Regards<br />
srikala