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)
Unable to access nested value in Scripted data set
msingh
Hi I am new to BIRT. I am using scripted dataset to access my values.
I am using Birt designer version 3.7.1.
Here is my code for the Open script and Fetch script of the data set.
//Open script
importClass(Packages.com.tcs.aov.dao.AovDAOImpl);
aovd = new AovDAOImpl();
//logToDebugWindow() is javascript function to debug my script.
logToDebugWindow("Open");
aovd = new AovDAOImpl();
if(aovd != null)
{
logToDebugWindow("aovd is not null");
}
else
{
logToDebugWindow("aovd is null");
}
aovAovData = aovd.getFirstPanelDetail("2011-06-01","2012-05-01","Monthly",null,null,"no");
if(aovAovData != null)
{
logToDebugWindow("aovAovData is not null");
}
else
{
logToDebugWindow("aovAovData is null");
}
aovlist = aovAovData.getBarAovList();
if(aovlist != null)
{
logToDebugWindow("Fetch aovlist is not null");
}
else
{
logToDebugWindow("Fetch aovlist is null");
}
count = 0;
//Open script end
// Fetch Script
if(aovlist != null && count < aovlist.size())
{
row["total_revenue"]=aovAovData.getBiTotalRevenue();
row["total_orders_count"]=aovAovData.getBfTotalOrdersCount();
row["total_aov"]= aovAovData.getBiTotalAov();
row["GRAND_TOTAL"]= aovlist.get(count).getBdGrandtotal();
row["TOTAL_ORDERS"]= aovlist.get(count).getBdTotalorders();
row["DATE_FROM"]= aovlist.get(count).getBdtDateFrom();
count++;
return true;
}
return false;
// Fetch Script end
When I preview results in the "Edit dataset" window, its working fine and fetching me results.
But when I preview the rptdesign file itself, its not working.
From debugging I found that "aovlist" becomes null for some unknown reason while previewing rptdesign file. Can anyone help me please???
aovAovData is an object having the following properties
1.An arraylist i.e "aovlist"
2.An int i.e. biTotalRevenue
3.A float i.e. bfTotalOrdersCount
4.An int i.e. biTotalAov
Find more posts tagged with
Comments
mwilliams
Can you attach your design?
msingh
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="108715" data-time="1345574656" data-date="21 August 2012 - 11:44 AM"><p>
Can you attach your design?<br /></p></blockquote>
<br />
Yes sure please look into this rptdesign file.<br />
I am also attaching the JavaScript file used for debugging.
mwilliams
Since I cannot run the report, what happens if you drag the dataSet into your layout, above the chart, to make a table. Does anything show?