Home
Analytics
How to quit generating report for non logined in user?
temphan
Hey
I add some code in beforefactory function of a report. Basically, these code try to read a specific cookie to verify that the report viewer is a login user.
If not, I would like stop generating report. I am just wondering where and how should I add some code to stop the report generating process.
I added a bunch of "return" in different script functions, but seems not working. Please help! Thanks.
Find more posts tagged with
Comments
mwilliams
Hi temphan,
The one place I know that you can stop a report from running inside BIRT is in a parameter's validate script. If you do your check there, you can return false and the report will not be run. You should also be able to do your check in your application outside of BIRT and choose not to call the report at all if they're not logged in.
temphan
Hey Michael
Thanks a lot for your reply, I add a check in parameter validate function, and the report did stop. However, in the webpage, it shows an error message, which is not nice to users. Is it possible that I can hide this error message or change it content?
org.eclipse.birt.report.service.api.ReportServiceException: Parameter "PT_1" script source validation error.
Best
mwilliams
temphan,<br />
<br />
If you create a custom parameter jsp page, you could do all your checks there and handle exceptions any way you'd like.<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.com/devshare/deploying-birt-reports/298-2-2-birt-tag-library/#description'>2.2
BIRT Tag Library - Tips & Tricks - BIRT Exchange</a><br />
<br />
Your best bet will probably be to check for the user's cookie before calling the BIRT report.
temphan
Hey, Michael
I read that paper but that solution is not working for me because most of the parameters in my report are generated by querying DB, which means the parameters are dynamic.
so I guess to provide user authentication, I have to modify the report viewer servlet or write my own servlet, could you please give me a few examples on how to do this. Many thanks.
temphan
By the way, I am use birt-runtime-2_3_1. Thanks.