I'm using birt to generate some reports and send them by email to the client.
i use java to call the report :
task.setRenderOption(options);
my question is can i prevent generating empty report using java or inside birt itself?
Thank you.
I assume that your are using BIRT to generate output (PDF or whatever), but that sending the email happens in your Java code.
You could set a variable dataFound to false in the appContext before calling task.run(). Inside your BIRT report, set the variable dataFound to true in the appContext, for example in an onFetch event.
Then, when the task has completed, get the variable from the appContext in your Java code. If it's still false, don't send.