Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
determine output according to result set
intellinx
Hello,
I am using the RE to create my reports & I'm looking for a way to know if the report
has any content. I know I can run the query before hand & decide whether to create the report or not,
but the query takes a lot of time so running it twice is not an option. an option I thought of is hiding the design objects according to the row.__rownum < 0 & then trying to determine the report's content by the file size. this is not a good solution as I don't want to rely on that.
is there a better option?
can I tell birt to not create an output file if the result set is empty?
Regards,
Avi
Find more posts tagged with
Comments
jhelbling
Hi intellinx,
It's maybe not exactly what you need, but it might provide you some ideas ... :
http://www.birt-exchange.org/org/devshare/designing-birt-reports/522-birt-display-quot-no-data-quot-when-table-is-empty-example/#description
intellinx
Thanks for your reply
but that is not what I need.
as you can see from my original post, I know how to hide the table(or display replacement text)
I actually don't mind if data are displayed or not.
I use the Report Engine & I need to know if the result set returned empty
so my application would know if to send the report to the client or not.
obviously I don't want to send an empty report.
thanks again,
Avi
johnw
Off the top of my head, the best way to do that is to use a Run then Render type call. Run your report. Then using a data extraction task on the rptDocument, check if the dataset is empty. if it is not, then go ahead and complete the render cycle.<br />
<br />
You also have another option of writing a custom ODA that will take in a Java resultset object as a parameter. Then you can run the query once, and just process the resultset in BIRT. You could do it the same way with a scripted data source as well. See this article: <a class='bbc_url' href='
http://techieocean.blogspot.com/2009/06/how-to-pass-resultset-to-birt-report.html'>http://techieocean.blogspot.com/2009/06/how-to-pass-resultset-to-birt-report.html</a><br
/>
<br />
<blockquote class='ipsBlockquote' data-author="'intellinx'" data-cid="68657" data-time="1285149922" data-date="22 September 2010 - 03:05 AM"><p>
Thanks for your reply<br />
<br />
but that is not what I need.<br />
as you can see from my original post, I know how to hide the table(or display replacement text)<br />
I actually don't mind if data are displayed or not. <br />
I use the Report Engine & I need to know if the result set returned empty<br />
so my application would know if to send the report to the client or not.<br />
obviously I don't want to send an empty report.<br />
<br />
thanks again,<br />
Avi<br /></p></blockquote>