Skip to main content



      Home
Home » Archived » BIRT » how to bring values from multidimentional java script array in 'initialize block' to dynamic text
how to bring values from multidimentional java script array in 'initialize block' to dynamic text [message #788905] Thu, 02 February 2012 06:11 Go to next message
Eclipse UserFriend
Hi all ,


i am beginner in birt . In my report i hav created one multidimentional array
in initialize method and i am assigning values to it
in onCreate method of Table as follows

role_table[totalcount] = new Array (
this.getRowData().getColumnValue("user_name"),
this.getRowData().getColumnValue("role"),
this.getRowData().getColumnValue("parent")

);

totalcount++;

But i am unable get this array in dynamic text . i tried with <value-of>
tag but it didnt worked. i want these values for populating html dropdown.[/size]

Is there any way to do so? Pls help.
Thanks..







Re: how to bring values from multidimentional java script array in 'initialize block' to dynamic [message #789247 is a reply to message #788905] Thu, 02 February 2012 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Take a look at the attached example.
Also remember the initialize event could be running multiple times. In
most cases beforeFactory is a better location.

Jason

On 2/2/2012 6:11 AM, rahul rahuldeshpande89@gmail.com wrote:
> Hi all ,
> i am beginner in birt . In my report i hav created one multidimentional
> array in initialize method and i am assigning values to it in onCreate
> method of Table as follows
> role_table[totalcount] = new Array (
> this.getRowData().getColumnValue("user_name"),
> this.getRowData().getColumnValue("role"),
> this.getRowData().getColumnValue("parent")
> );
> totalcount++;
>
> But i am unable get this array in dynamic text . i tried with <value-of>
> tag but it didnt worked. i want these values for populating html
> dropdown.[/size]
>
> Is there any way to do so? Pls help.
> Thanks..
>
>
>
>
>
Re: how to bring values from multidimentional java script array in 'initialize block' to dynamic [message #789251 is a reply to message #788905] Thu, 02 February 2012 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Take a look at the attached example.
Also remember the initialize event could be running multiple times. In
most cases beforeFactory is a better location.

Jason

On 2/2/2012 6:11 AM, rahul rahuldeshpande89@gmail.com wrote:
> Hi all ,
> i am beginner in birt . In my report i hav created one multidimentional
> array in initialize method and i am assigning values to it in onCreate
> method of Table as follows
> role_table[totalcount] = new Array (
> this.getRowData().getColumnValue("user_name"),
> this.getRowData().getColumnValue("role"),
> this.getRowData().getColumnValue("parent")
> );
> totalcount++;
>
> But i am unable get this array in dynamic text . i tried with <value-of>
> tag but it didnt worked. i want these values for populating html
> dropdown.[/size]
>
> Is there any way to do so? Pls help.
> Thanks..
>
>
>
>
>
Re: how to bring values from multidimentional java script array in 'initialize block' to dynamic [message #789256 is a reply to message #788905] Thu, 02 February 2012 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Take a look at the attached example.
Also remember the initialize event could be running multiple times. In
most cases beforeFactory is a better location.

Jason

On 2/2/2012 6:11 AM, rahul rahuldeshpande89@gmail.com wrote:
> Hi all ,
> i am beginner in birt . In my report i hav created one multidimentional
> array in initialize method and i am assigning values to it in onCreate
> method of Table as follows
> role_table[totalcount] = new Array (
> this.getRowData().getColumnValue("user_name"),
> this.getRowData().getColumnValue("role"),
> this.getRowData().getColumnValue("parent")
> );
> totalcount++;
>
> But i am unable get this array in dynamic text . i tried with <value-of>
> tag but it didnt worked. i want these values for populating html
> dropdown.[/size]
>
> Is there any way to do so? Pls help.
> Thanks..
>
>
>
>
>
Re: how to bring values from multidimentional java script array in 'initialize block' to dynamic [message #789261 is a reply to message #788905] Thu, 02 February 2012 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Take a look at the attached example.
Also remember the initialize event could be running multiple times. In
most cases beforeFactory is a better location.

Jason

On 2/2/2012 6:11 AM, rahul rahuldeshpande89@gmail.com wrote:
> Hi all ,
> i am beginner in birt . In my report i hav created one multidimentional
> array in initialize method and i am assigning values to it in onCreate
> method of Table as follows
> role_table[totalcount] = new Array (
> this.getRowData().getColumnValue("user_name"),
> this.getRowData().getColumnValue("role"),
> this.getRowData().getColumnValue("parent")
> );
> totalcount++;
>
> But i am unable get this array in dynamic text . i tried with <value-of>
> tag but it didnt worked. i want these values for populating html
> dropdown.[/size]
>
> Is there any way to do so? Pls help.
> Thanks..
>
>
>
>
>
Re: how to bring values from multidimentional java script array in 'initialize block' to dynamic [message #789264 is a reply to message #788905] Thu, 02 February 2012 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Take a look at the attached example.
Also remember the initialize event could be running multiple times. In
most cases beforeFactory is a better location.

Jason

On 2/2/2012 6:11 AM, rahul rahuldeshpande89@gmail.com wrote:
> Hi all ,
> i am beginner in birt . In my report i hav created one multidimentional
> array in initialize method and i am assigning values to it in onCreate
> method of Table as follows
> role_table[totalcount] = new Array (
> this.getRowData().getColumnValue("user_name"),
> this.getRowData().getColumnValue("role"),
> this.getRowData().getColumnValue("parent")
> );
> totalcount++;
>
> But i am unable get this array in dynamic text . i tried with <value-of>
> tag but it didnt worked. i want these values for populating html
> dropdown.[/size]
>
> Is there any way to do so? Pls help.
> Thanks..
>
>
>
>
>
Re: how to bring values from multidimentional java script array in 'initialize block' to dynamic [message #789268 is a reply to message #788905] Thu, 02 February 2012 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Take a look at the attached example.
Also remember the initialize event could be running multiple times. In
most cases beforeFactory is a better location.

Jason

On 2/2/2012 6:11 AM, rahul rahuldeshpande89@gmail.com wrote:
> Hi all ,
> i am beginner in birt . In my report i hav created one multidimentional
> array in initialize method and i am assigning values to it in onCreate
> method of Table as follows
> role_table[totalcount] = new Array (
> this.getRowData().getColumnValue("user_name"),
> this.getRowData().getColumnValue("role"),
> this.getRowData().getColumnValue("parent")
> );
> totalcount++;
>
> But i am unable get this array in dynamic text . i tried with <value-of>
> tag but it didnt worked. i want these values for populating html
> dropdown.[/size]
>
> Is there any way to do so? Pls help.
> Thanks..
>
>
>
>
>
Re: how to bring values from multidimentional java script array in 'initialize block' to dynamic [message #789273 is a reply to message #788905] Thu, 02 February 2012 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Take a look at the attached example.
Also remember the initialize event could be running multiple times. In
most cases beforeFactory is a better location.

Jason

On 2/2/2012 6:11 AM, rahul rahuldeshpande89@gmail.com wrote:
> Hi all ,
> i am beginner in birt . In my report i hav created one multidimentional
> array in initialize method and i am assigning values to it in onCreate
> method of Table as follows
> role_table[totalcount] = new Array (
> this.getRowData().getColumnValue("user_name"),
> this.getRowData().getColumnValue("role"),
> this.getRowData().getColumnValue("parent")
> );
> totalcount++;
>
> But i am unable get this array in dynamic text . i tried with <value-of>
> tag but it didnt worked. i want these values for populating html
> dropdown.[/size]
>
> Is there any way to do so? Pls help.
> Thanks..
>
>
>
>
>
Re: how to bring values from multidimentional java script array in 'initialize block' to dynamic [message #789278 is a reply to message #788905] Thu, 02 February 2012 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Take a look at the attached example.
Also remember the initialize event could be running multiple times. In
most cases beforeFactory is a better location.

Jason

On 2/2/2012 6:11 AM, rahul rahuldeshpande89@gmail.com wrote:
> Hi all ,
> i am beginner in birt . In my report i hav created one multidimentional
> array in initialize method and i am assigning values to it in onCreate
> method of Table as follows
> role_table[totalcount] = new Array (
> this.getRowData().getColumnValue("user_name"),
> this.getRowData().getColumnValue("role"),
> this.getRowData().getColumnValue("parent")
> );
> totalcount++;
>
> But i am unable get this array in dynamic text . i tried with <value-of>
> tag but it didnt worked. i want these values for populating html
> dropdown.[/size]
>
> Is there any way to do so? Pls help.
> Thanks..
>
>
>
>
>
Re: how to bring values from multidimentional java script array in 'initialize block' to dynamic [message #789281 is a reply to message #788905] Thu, 02 February 2012 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Take a look at the attached example.
Also remember the initialize event could be running multiple times. In
most cases beforeFactory is a better location.

Jason

On 2/2/2012 6:11 AM, rahul rahuldeshpande89@gmail.com wrote:
> Hi all ,
> i am beginner in birt . In my report i hav created one multidimentional
> array in initialize method and i am assigning values to it in onCreate
> method of Table as follows
> role_table[totalcount] = new Array (
> this.getRowData().getColumnValue("user_name"),
> this.getRowData().getColumnValue("role"),
> this.getRowData().getColumnValue("parent")
> );
> totalcount++;
>
> But i am unable get this array in dynamic text . i tried with <value-of>
> tag but it didnt worked. i want these values for populating html
> dropdown.[/size]
>
> Is there any way to do so? Pls help.
> Thanks..
>
>
>
>
>
Re: how to bring values from multidimentional java script array in 'initialize block' to dynamic [message #789284 is a reply to message #788905] Thu, 02 February 2012 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Take a look at the attached example.
Also remember the initialize event could be running multiple times. In
most cases beforeFactory is a better location.

Jason

On 2/2/2012 6:11 AM, rahul rahuldeshpande89@gmail.com wrote:
> Hi all ,
> i am beginner in birt . In my report i hav created one multidimentional
> array in initialize method and i am assigning values to it in onCreate
> method of Table as follows
> role_table[totalcount] = new Array (
> this.getRowData().getColumnValue("user_name"),
> this.getRowData().getColumnValue("role"),
> this.getRowData().getColumnValue("parent")
> );
> totalcount++;
>
> But i am unable get this array in dynamic text . i tried with <value-of>
> tag but it didnt worked. i want these values for populating html
> dropdown.[/size]
>
> Is there any way to do so? Pls help.
> Thanks..
>
>
>
>
>
Re: how to bring values from multidimentional java script array in 'initialize block' to dynamic [message #789607 is a reply to message #789247] Fri, 03 February 2012 02:07 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jason ,
thanks a lot . this example helped me a lot .
but my problem is with multidimentional array.
i tried in this way

var myarray = '<value-of>role_table.toString()</value-of>';
var data = myarray.split('/');//row delimeter of role_table
var role_table1= new Array();
for(var i= 0;i<data.length-1;i++)
{
if(i<1)
role_table1[i]= new Array(data[i].split(','));//cell delimeter of role_table
else
role_table1[i]=new Array(data[i].slice(1).split(','));

}
alert(role_table1[0][0][0]);

but it lowered my report performance as it taking much time for loading.

Re: how to bring values from multidimentional java script array in 'initialize block' to dynamic [message #790003 is a reply to message #789607] Fri, 03 February 2012 12:30 Go to previous message
Eclipse UserFriend
Is the performance impact on the client side while it build the client
side array? I would think the split operation and the for loop would be
the cause of bad performance. Why not just create the array string on
server. Look at the modified example. It shows how to create a
multidimensional array two ways. The first is similar to the approach
of the previous example and the second creates the array string on the
server as each row is processed. Look at the scripts and look for
myarraystring variable. It is presented in the second text element with
the blue background.

Jason

On 2/3/2012 2:07 AM, rahul rahuldeshpande89@gmail.com wrote:
> Hi Jason ,
> thanks a lot . this example helped me a lot .
> but my problem is with multidimentional array.
> i tried in this way
> var myarray = '<value-of>role_table.toString()</value-of>';
> var data = myarray.split('/');//row delimeter of role_table
> var role_table1= new Array();
> for(var i= 0;i<data.length-1;i++)
> { if(i<1)
> role_table1[i]= new Array(data[i].split(','));//cell delimeter of
> role_table
> else
> role_table1[i]=new Array(data[i].slice(1).split(','));
>
> }
> alert(role_table1[0][0][0]);
>
> but it lowered my report performance as it taking much time for loading.
>
>
Previous Topic:"vertical" page breaks
Next Topic:Uh-Oh (re: #786618)
Goto Forum:
  


Current Time: Wed Jul 23 03:46:14 EDT 2025

Powered by FUDForum. Page generated in 0.29034 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top