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)
Need to change DataSet queryText within outer JScript event
griniland
<p>Have 2 XML dataSets, DS1 and DS2.</p><p> </p><p>Need to change DS2 row XPATH depending on values retrieved from DS1</p><p> </p><p> </p><p>DS1 has two events</p><p> :onFetch (where I collect data to ArrayList(<HashMap>). It works fine.</p><p> :beforeClose.</p><p>Here I want to redifine DS2.queryText property:</p><p> </p><p>Consecutivly,</p><p> </p><p>I tried:</p><pre class="_prettyXprint">reportContext.getDesignHandle().getModuleHandle.findDataSet("DS2").setProperty("queryText",text); </pre><p>also tried:</p><pre class="_prettyXprint">reportContext.getReportRunnable().designHandle.getDesignHandle().findDataSet("DS2").setProperty("queryText",text)</pre><p>overmore, tried:</p><pre class="_prettyXprint">reportContext.getReportRunnable().getDesignInstance().getDataSet("DS2").queryText=text</pre><p>No errors, everything looks fine.</p><p> </p><p> </p><p> </p><p>then I go to DS2.beforeOpen event to examine changes, and see that nothing has changed:</p><p> </p><p>this.queryText has not been changed!</p><p> </p><p>Well, I can do a "walkaround" with global variable, but this is the way to **** for me.</p><p> </p><p> </p><p> </p><p> </p><p> </p><p>I guess I'm wrong addressing to property DS2.queryText from my outer scripts, so what is it's right notation?</p>
Find more posts tagged with
Comments
CBR
<p>I m sorry to say that but it looks like you have to use a global variable.</p><p>Changing something using the design instance only works in beforeFactory. Chaning some aspects of any element later then beforeFactory does not give an error but has no effect either.</p><p> </p><p>what i would do:</p><p>Use a global variable in DS1. Use before open of DS2 to change the query accordingly using the global variable.</p><p>the only thing you would have to guarantee is that DS1 has to be used in an element before DS2 is beeing used.</p>