Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
I want script center for my reports
dzish
Hi,
I use same scripts in beforeFactory in many reports so it's duplicated. I thought about centralizing of my scripts to one place. I chose datasource with event beforeOpen. This place because I have only one datasource.
But script is not called.
Am I wrong with something? Is there any other sollution to centralize calling of script?
As side effect you can see my recursive function of dropping elements. I don't see another sollution of dropping all elements because of iterator.
thanks for suggestions
Jan
Find more posts tagged with
Comments
mwilliams
Hi Jan,
You could put your script into an external java file and override the script and use the eventHandler feature. Check out the following devShare post to see how to do eventHandlers in BIRT.
http://www.birt-exchange.org/org/devshare/deploying-birt-reports/1060-scripting-event-handler-samples/
dzish
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="65378" data-time="1276007142" data-date="08 June 2010 - 07:25 AM"><p>
Hi Jan,<br />
<br />
You could put your script into an external java file and override the script and use the eventHandler feature. Check out the following devShare post to see how to do eventHandlers in BIRT.<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/deploying-birt-reports/1060-scripting-event-handler-samples/'>http://www.birt-exchange.org/org/devshare/deploying-birt-reports/1060-scripting-event-handler-samples/</a><br
/></p></blockquote>
<br />
Thank you Michael but I meant something different. Excuse me I wasn't accurate. <br />
I have js files and calling of theirs function is duplicated. And it's similiar with java handlers I'm afraid.<br />
<br />
I have many installations of same product with different databases in a lot of datasets like<br />
"SELECT name FROM <em class='bbc'>installation_database</em>.employee"<br />
"SELECT id, age FROM <em class='bbc'>installation_database</em>.age"<br />
"SELECT id, country FROM <em class='bbc'>installation_database</em>.country"<br />
<br />
Changing of database name I have in js file in function. I have to call this function in beforeOpen event of each dataset.
mwilliams
Jan,
So, you're calling the same function multiple times to figure out what database table to call? I think I might still be confused. Let me know if I have this correct or not. If I do, you could probably call the function in the initialize method of your report and store the database table value in a variable that you can recall in the beforeOpen of each dataSet. This way you only call the external file once.