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)
Adding Custom Events to Birt
SDusad
Hi All,
I want ot know that can i add custom events to BIRT whcih can be used in Javascript and Java as well.
If yes then which is the extension point defined for the same.
Thanks and Regards
Sushant Dusad
Find more posts tagged with
Comments
Virgil Dodson
Hi Sushant,
BIRT already has a number of events that you can override for server-side processing of the report... Are you looking to write code against a server event... or client event?
SDusad
Hi Virgil,
I am actually looking at adding events in addition to the available events in BIRT which gets executed when the report is run be it from the BIRT RCP or when i deploy it on the Application server.
Thanks and Regards
Sushant Dusad
Virgil Dodson
Hi Sushant,
There are several places where you can call your custom Java and Javascript code. Can you give me an idea of the type of custom event you would like to create?
SDusad
I wan to add key stroke events where in when i press a key combination my custom event handler runs.
Thanks and Regards
Sushant Dusad
Virgil Dodson
Since this sounds like you are trying to add Client side events, then Javascript is what you should use. For a BIRT report rendered in the browser, you can add a Text Control, select HTML for formatting, and then use a script like below.
<script language="javascript">
if (document.layers) { document.captureEvents(Event.KEYPRESS); }
document.onkeypress = getKey;
function getKey(keyStroke) {
var keyCode = (document.layers) ? keyStroke.which : event.keyCode;
var keyString = String.fromCharCode(keyCode).toLowerCase();
alert("keyCode="+keyCode+" keyString="+keyString);
}
</script>
When added to a BIRT report, this script will detect the keystroke of the user and display that they have typed.
SDusad
Thanks. Now i will be able to track the key stroke events.