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)
Chart scripting
moflopes
Hello!
I am working on developing a debugging system for our reports, and I'm having trouble outputting information from charts. Elsewhere all I need to do is a command, which references a javascript function inserted into the report, such as:
logToDebugWindow("stuff");
But this doesn't work with charts. I am wondering what am I missing or if there's a workaround you guys can think of? I am using BIRT version 2.3.2.
Thank you.
Find more posts tagged with
Comments
mwilliams
There are a few possibilities I can think of here. Charts have their own engine api, so the rest of the report and the chart don't always run hand in hand. You may have to pass the connection info to your debug window into your chart script through a variable or something. Another possibility is that most of the charting occurs in onRender, so depending on what output you're running this in or if you're just debugging the run task and not the render task, thing could not be being called for you as you're expecting. Are you running this in the designer or deployed? Also, what is your output? Do you see different if you run the report to HTML vs PDF vs the Web Viewer, etc?
moflopes
I'm running on designer. My debug output is a simple window with lines of text, and the results are identical in the three different report outputs you listed.<br />
<br />
Your first idea might be the way to go, can you give me an example of such code? My window is made with javascript and it's all inserted into the initialize event of the report.<br />
<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="80322" data-time="1311178384" data-date="20 July 2011 - 09:13 AM"><p>
There are a few possibilities I can think of here. Charts have their own engine api, so the rest of the report and the chart don't always run hand in hand. You may have to pass the connection info to your debug window into your chart script through a variable or something. Another possibility is that most of the charting occurs in onRender, so depending on what output you're running this in or if you're just debugging the run task and not the render task, thing could not be being called for you as you're expecting. Are you running this in the designer or deployed? Also, what is your output? Do you see different if you run the report to HTML vs PDF vs the Web Viewer, etc?<br /></p></blockquote>
mwilliams
If you can pass the window info in through script, it'll probably be through a persistentGlobalVariable. You can pass a string or an object through this. In the initialize method, you'd create the variable with reportContext.setPersistentGlobalVariable("loggingWindowInfo",windowInfoStringOrObject);. Then, you'd recall it in your chart with icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("loggingWindowInfo"). Not sure if this is what you'll need to do since I don't know what your code looks like, but maybe this information will help.
moflopes
icsc.getExternalContext (). getScriptable does not have the getPersistentGlobalVariable method. There's another way to access the global variable, in the chart script?
moflopes
image
mwilliams
Trust me. It's there, it just doesn't show.