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)
scripted datasource
birtq
Hi
Please see to it if you can find the solution of it
why the coloumn A of dataset is not containing ("A,B,C,D") as its value rather it contains("D,D,D,D").
secondly "newparameter" linked with dataset is not fetching its value(D,D,D,D)(at presnt) ,in the listbox "newparameter".
Thanks
birtq
Find more posts tagged with
Comments
mwilliams
Hi birtq,
What version of BIRT are you using?
birtq
Hi
The birt version which i am using is 2.3.0 !!!
Thanks
birtq
birtq
Hi,
please find the report as an attachment to find the problem.
Thanks,
birtq
mwilliams
birtq,
Do you have a version of this report that runs so I can see the values? The report will not run because of the "new parameter" issue. What are you trying to achieve with the parameters and this report?
birtq
Hi
thanks for ur reply.
the report that i have attached above runs on birt2.3.0.
when the report is executed the newparameter named parameter doesnt fetch value in it from the dataset made from a scripted datasource.
So the issue is how to have 4 rows with values A B C D of a coloumn("xyz") of dataset made from a scripted datasource and attach this dataset to listbox parameter which will conatin these 4 values.
i have tried implementing the same in the report but there is some issue.
Thanks,
birtq
mwilliams
birtq,
There was a bracket commented out in the script on the dataSet. That was the problem I was having. It is running now and I'm getting "D, D, D, D" for the dataSet values and nothing in the second parameter box like you said. I'll take a look at it and see if I can offer any help.
birtq
Thanks a lot.
sure,waiting for your reply:-)
birtq
Hi
Hoping to get a reply on this soon as possible because i am not able to make proper chnages to get the required result out of it.
Thanks
birtq
mwilliams
birtq,<br />
<br />
Sorry for the delay in looking at your report design. By changing the code to the following, you can get A, B, C, D in the dataSet. I have not started looking at the parameters yet. Just thought I'd pass this along. All you're wanting to do with the parameter is get the 4 values to return, correct?<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var myarr = new Array();
myarr[0] = "A";
myarr[1] = "B";
myarr[2] = "C";
myarr[3] = "D";
myarr.sort();
reportContext.getPersistentGlobalVariable("quetext");
var parmcount =myarr.length;
//if (cnt<parmcount)
//{
//cnt=cnt+1;
while(cnt<parmcount)
{
if(myarr[cnt]!=quetext)
{
row["A"] = myarr[cnt];
cnt++;
return true;
}
//}
}
return true;
</pre>
mwilliams
birtq,<br />
<br />
Ok, here's the updated scripting you need to do on the dataSet for it to return (A, B, C, D), and for the parameter to be able to dynamically pick them out.<br />
<br />
In the open method:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
myarr = new Array();
myarr[0] = "A";
myarr[1] = "B";
myarr[2] = "C";
myarr[3] = "D";
myarr.sort();
parmcount =myarr.length;
cnt = 0;
</pre>
<br />
In the fetch method:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if (cnt>=parmcount)
{
return (false);
}
row["A"] = myarr[cnt];
cnt++;
return (true);
</pre>
<br />
If you have more questions on scripted dataSources. There is also an example in the devShare that you can download here:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.com/devshare/designing-birt-reports/544-sample-birt-scripted-data-source-example/'>Sample
BIRT Scripted Data Source Example - Designs & Code - BIRT Exchange</a>
birtq
Hi Michael,
Its working Absolutly perfect.
Thankyou soo much:-)
Thanks and Regards,
birtq