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)
Issue with Global Variable
ghaniik
<p>I have an issue while getting global variable.</p>
<p> </p>
<p>I have two datasets, dataset1 and dataset2.</p>
<p> </p>
<p>dataset1 is associated to table1, dataset2 is associated to table2. </p>
<p>table2 is inside table1 in UI.</p>
<p>I am setting the global variable in dataset2 fetch method and trying to display it on table1.</p>
<p>but I am not getting any value in UI after running the report.</p>
<p>I have attached sample layout for reference.</p>
<p> </p>
<p>did anyone faced this issue earlier.</p>
<p> </p>
<p>Thanks</p>
Find more posts tagged with
Comments
Matthew L.
<p>I believe I know whats happening, assuming you are using the following commands to Set/Get the global variable:</p>
<pre class="_prettyXprint _lang-js">
reportContext.setPersistentGlobalVariable("MyGlobalVar", "MyStringValue"); //Set global variable called MyGlobalVar
var value = reportContext.getPersistentGlobalVariable("MyGlobalVar"); //Get global variable called MyGlobalVar
</pre>
<p>If you move the "Global variable" element from the last column and place it under "Table1" element in the first column, does it display a value?</p>
<p>If so, then its an order of operations issue (I've seen tables built by the report engine from right to left).</p>
<p>This can be fixed by changing the method used to set the "Global variable" element's (example: onRender).</p>
<p>If it doesn't show a value after moving it, try placing the element after the entire table to verify that it's getting a value.</p>
<p> </p>
<p>If you have a sample report to post, I could take a look for you.</p>
ghaniik
<div>Hi Matthew,</div>
<div> </div>
<div>Thanks a lot for your response on my issue. As you have suggested I have added the field under table1 column but it didnt work, however it worked when I placed the column outside table1. I have also tried onrender,afterFactor,onPageEnd method, but didnt had much luck. I am attaching the report for your reference. Request you to take a look.</div>
<div> </div>
<div>Once again thanks for the response. </div>
Matthew L.
<p>Looking at the report design, I see that Maximo is being used.</p>
<p>I have very little knowledge of Maximo, however from my current understanding of Maximo, the report is generated one element at a time from top to bottom and tables/grids are generated right to left.</p>
<p>Because of how it generates reports, I believe this is the reason that onRender,afterFactory,onPageEnd methods didn't have an effect.</p>
<p> </p>
<p>In your example, how many rows does the main table generate (1 row, 3 rows, etc)?</p>
<p>How many rows does each little table generate (1 row per main table row, 3 rows per main table row, etc)?</p>
<p>If the main table generates more than 1 row, does the second row "Days [Data]" show a value (perhaps the value from the first row)?</p>
<p> </p>
<p>Also, what is the final output that you are wanting to accomplish?</p>
<p>Do you have a mock-up with fake data and what the output of the fake data should look like?</p>
<p> </p>
<p>Attached is my modified version of your design that I think replicates the behavior you are seeing, but from within the designer instead of Maximo.</p>
ghaniik
<p>Main Table values are based on the query so depends on input criteria(date range is the criteria).</p>
<p>table 2 generates values based on the Main Table, i.e. for each value of Main table, table 2 generates data, this also may vary based on the data.</p>
<p> </p>
<p>I am attaching the mock up with highlighted columns.</p>
<p>I want to add the columns A1 through A5 and display it in A6.</p>
<p>A2 value is from table 2(Highlighted in Maroon), while all other values are from Main table.</p>
<p> </p>
<p> </p>
<p>Thanks,</p>
ghaniik
<p>Hi,</p>
<p> </p>
<p>I tried setting Excel Emitter user properties, it is not working, is there any other work around for this?</p>
<p> </p>
<p>Thanks,</p>