Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Broken Javascript when adding a dataset field with an importPackage statement
Migrateduser
<p>Ok, I'm totally confused by this one. I have a text box on the layout section that has some javascript in the onRender section to reformat a report parameter that is passed in as an integer type. I also assigned it to a report variable with the expression params["parameter_name"].value.</p><p> </p><p>The code in the textbox that uses the report variable is blockId = vars["rv_ca_blockId"].toString();</p><p> </p><p>This was working just fine until I added a couple of fields from two different datasets to the footer on the Master Page. Basically I have two datasets getting money information from a transaction table. All transactions processed by a specific employee for a day get a unique number. One dataset gets any rows for that day's unique number that are of payment type "check" and that dataset is used to list out each check amount & and ID number. The other dataset goes back in and for the same unique number gets any rows that are of type "cash" and just adds it up. </p><p> </p><p>In the footer I need to be able to add the check total and the cash total together. I use computed fields in the datasets to first get the totals and then the as per some searches I found here on how to add things from two different datasets I use the following script for example in the onCreate section to assign the values to a global variable </p><p> </p><div><pre class="_prettyXprint">importPackage(Packages.java.lang);if (this.getValue() == null){this.setDisplayValue(parseFloat("0.00"));}var mydbl = new Double(this.getValue());reportContext.setGlobalVariable("totalCash", mydbl);</pre><p>I saw a lot of references to using setPersistentGlobalVariable instead but that never worked for some reason. Anyway, something about having to use the "importPackage" statement is breaking the ability to use toString() in the other script. I get the error error instantiating (): class java.lang.Number is interface or abstract when BIRT tries to run that script with the blockId = vars["rv_ca_blockId"].toString(); statement in it. If I leave off toString() then I get errors about Int vs. string of course. Anyone have any ideas on this? I'm completely lost.</p></div>
Find more posts tagged with
Comments
There are no comments yet