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)
Manually adding a row in fetch() method
Dragunov
Hi all,
i am doing some experiment with BIRT. I have a scripted dataset,
In side the fetch method under the condition if(!dataSet.fetch()) i want to manually add a row.
the script looks like this
if(!dataSet.fetch())
{
row["startingBalance"]=10000;
row["expectedReturn"]=12000;
return false;
}
row["startingBalance"] = dataSet.getInteger("strtBal");
row["expectedReturn"] =dataSet.getInteger("expReturn");
return true;
But this is not working the values that i am manually assigning inside the if () condition doesnt get reflected. No errors are shown, report is working fine except that the values that i had assigned doesnt come.
I cant understand why the new row is not getting created. Am i not supposed to assign any row values inside the if(!dataSet.fetch()) ?
Can any body explain me why this is happening?
Find more posts tagged with
Comments
Dragunov
Hi all, i myself found the solution . Thought of sharing it here.
The problem was the statement
return false;
in the code snippet
if(!dataSet.fetch())
{
row["startingBalance"]=10000;
row["expectedReturn"]=12000;
return false;
}
If the fetch method returns false; the newly created row wont be added.
So for a new row to be added , the fetch method should return true.
I had made a small work around and made my script working.
thanks to all..