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)
Access to DataItem in the Script/Function
dineshbs
Hi,<br />
<br />
I am trying to use a Custom Function in a script to custom translate a value. I am using XML as the data source with the xpath of XML elements specified in the columnMapping.<br />
<br />
I have the following expression in the Report Layout for a DataItem:<br />
<br />
<strong class='bbc'>Report.GetTranslation(reportContext, row, dataSetRow["col1"])</strong><br />
<br />
I want to know the columnBinding name of the DataItem (and later retrieve the xpath as well) inside my custom function, that resulted in the call to the function.<br />
<br />
The <strong class='bbc'>reportContext</strong> getting passed from the script to the function does not give me access to the Dataitem that needs translation.<br />
<br />
<strong class='bbc'>IFunctionContext</strong> is also useless in determining which DataItem this function was called for.<br />
<br />
<strong class='bbc'>row</strong> is giving a <strong class='bbc'>JSResultSetRow</strong> Object, but it doesn't give me access to the Bindingmap that is stored about 6-7 levels deep inside the <strong class='bbc'>JSResultSetRow</strong> Object (starting with odiResult that is declared private and no getter method there as well).<br />
<br />
I tried passing various parameters to the function using other keywords like report, design, config, etc. in the script. But none of them gave me access to the dataitem. <br />
<br />
Can anyone please help me ? Even if I can get a propertyname for the Dataitem that would help, so I can do a findelement on the ReportDesignHandle.<br />
<br />
Is there a list of variables (keywords) that provide access to various run time parameter values (similar to reportContext, design, etc) stored as a cross-reference somewhere ?<br />
<br />
Thanks,<br />
Dinesh
Find more posts tagged with
Comments
dineshbs
Hi,
I am trying to use a Custom Function in a script to custom translate a value. I am using XML as the data source with the xpath of XML elements specified in the columnMapping.
I have the following expression in the Report Layout for a DataItem:
Report.GetTranslation(reportContext, row, dataSetRow["col1"])
I want to know the columnBinding name of the DataItem (and later retrieve the xpath as well) inside my custom function, that resulted in the call to the function.
The reportContext getting passed from the script to the function does not give me access to the Dataitem that needs translation.
IFunctionContext is also useless in determining which DataItem this function was called for.
row is giving a JSResultSetRow Object, but it doesn't give me access to the Bindingmap that is stored about 6-7 levels deep inside the JSResultSetRow Object (starting with odiResult that is declared private and no getter method there as well).
I tried passing various parameters to the function using other keywords like report, design, config, etc. in the script. But none of them gave me access to the dataitem.
Can anyone please help me ? Even if I can get a propertyname for the Dataitem that would help, so I can do a findelement on the ReportDesignHandle.
Is there a list of variables (keywords) that provide access to various run time parameter values (similar to reportContext, design, etc) stored as a cross-reference somewhere ?
Thanks,
Dinesh
johnw
Maybe you can set a global report variable with the value by overriding the OnCreate event. Not sure if that will work with aggregation functions though.
dineshbs
I have the same problem here too.
How do I access the report item's property in the onCreate method to set the global report variable's value ?