Hi guys, <br />
I start a new topic with this error. Because I think maybe the solution could useful for someone.<br />
<br />
I use this script:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>var Spalten = "[1,5,52,58]";
var i, Wert, Newsql;
Wert = Spalten;
Wert = Wert.substring(1, Wert.length - 1).split(",");
Wert.length = 10;
for (i = 0; i < 10; i += 1) {
if (Wert[i]) {
Wert[i] = "SP" + Wert[i] + " as ZE" + (i + 1);
} else {
Wert[i] = "ZE999 as SP" + (i + 1);
}
}
Newsql = Wert.join();
Newsql;</pre>
<br />
If I run this script in a browser or within this online tool: <a class='bbc_url' href='
http://pjunk.de/webtools/onlinejs.html'>http://pjunk.de/webtools/onlinejs.html</a><br />
then I get this string: <blockquote class='ipsBlockquote' ><p>SP1 as ZE1,SP5 as ZE2,SP52 as ZE3,SP58 as ZE4,ZE999 as SP5,ZE999 as SP6,ZE999 as SP7,ZE999 as SP8,ZE999 as SP9,ZE999 as SP10</p></blockquote>
<br />
But when I use this sript in Birt on beforeFacotry or beforeOpen or Data Field I always get this error:<br />
<blockquote class='ipsBlockquote' ><p>Cannot convert NaN to java.lang.Integer (/report/method[
@name="initialize"]#38) (Element ID:1)</p></blockquote>
#38 = <pre class='_prettyXprint _lang-auto _linenums:0'>Wert = Wert.substring(1, Wert.length - 1).split(",");</pre>
<br />
Please give me your suggestions how I could solve this problem.<br />
<br />
best regards<br />
Rafael