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)
Include data source value in grid
chuckles
Hello-
I am trying to figure out how to include the datasource connect string into a grid element in a report. I can successfully acquire the data using the following in the datasource 'afterOpen' event:
reportContext.setPersistentGlobalVariable("host",this.getExtensionProperty('odaURL'));
Retrieving the GlobalVariable in a standalone text field's 'onCreate' event works fine:
this.text = reportContext.getPersistentGlobalVariable("host");
However, the problem occurs when moving the text field into a grid. The reason that this fails is that when in a grid, the text field's 'onCreate' event fires before the DataSource's 'afterOpen' event. Therefore, I'm retrieving and using the global variable before it's value is set, thus resulting in a <null> value in the report. Moving the text field back out of the grid changes when the event fires (after the data source event), thus correctly displaying the connect string- although in the wrong place.
I would appreciate any help in figuring out how to retrieve the connect string and drop it into a grid.
thanks!
Find more posts tagged with
Comments
mwilliams
Did you bind the dataSet that you're trying to use the value from to the grid? This should do it, I think.
chuckles
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="70676" data-time="1290535085" data-date="23 November 2010 - 10:58 AM"><p>
Did you bind the dataSet that you're trying to use the value from to the grid? This should do it, I think.<br /></p></blockquote>
<br />
Michael-<br />
<br />
Thank you for the quick response, however, I'm not exactly following you. For this particular field, I have not created a dataset, as the data I'm trying to display in the report is not stored in the datasource, instead I'm looking to display the properties of the datasource being used.<br />
<br />
For example, my desired output is<br />
column 1: hostname<br />
column 2: value #1<br />
column 3: value #2<br />
<br />
Columns 2 and 3 in the above sample successfully query the host (which is the value of column #1 above) and return the correct data appropriately. I will be running this identical report on multiple hosts, with each returning the same data and am looking for a method to distinguish which host the given data came from. My expectation is that I should be using the jdbc connect string for the host info.<br />
<br />
I hope this helps.<br />
thanks a bunch!
mwilliams
If a dataSet is not bound to anything, it will not be called or set up. You'll need to have some item bound to the dataSource/Set that you're calling for the script methods to be called. If you don't call the dataSource/Set before where you try to display the value that you set in the script, it will not be set.
Hope this helps.
chuckles
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="70691" data-time="1290540851" data-date="23 November 2010 - 12:34 PM"><p>
If a dataSet is not bound to anything, it will not be called or set up. You'll need to have some item bound to the dataSource/Set that you're calling for the script methods to be called. If you don't call the dataSource/Set before where you try to display the value that you set in the script, it will not be set.<br />
<br />
Hope this helps.<br /></p></blockquote>
<br />
OK, got it figured out now, thanks. It turns out that I need to have a bound item as the first (leftmost) column in the grid. All I did was move one of the other columns to the front and it's working.<br />
<br />
<br />
thanks!
mwilliams
Not a problem! Let us know whenever you have questions!