cancel
Showing results for 
Search instead for 
Did you mean: 

Table row index through scripting

Former Member
0 Kudos

Hi Experts,

Could anyone suggest a script to get the current row index of the table in Print Form?

Thanks,

Abd-Al-Aleem

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member

I figured out.

I can use the javascript this.index to get the current row index

Former Member
0 Kudos

Hi,

Do follow the post [Read Table Java script|; (consider only the third reply of mine in that post). Change the code accordingly to your perspective.

Regards

Pradeep Goli

Former Member
0 Kudos

Hi Pradeep,

Could you correct my logic here?

Var i;

// Get the current accounting document

var l_belnr = this.resolveNode("Row.BELNR");

// Get the number of rows in the internal table

var norows = xfa.resolveNodes("Data.Table.Row[*]").length;

// Loop until the same accounting document is reached to find the row index

for ( i=0; i<norows; i++)

{

if ( l_belnr = xfa.resolveNodes("Data.Table.Row["i"].BELNR").rawValue )

// Break for current record

break;

}

// Calculate the modulo 6

var j = i%6;

// Check if the modulo result is 0

if ( j = 0 );

I am writing this at row level to trigger a page break when the result of calculation is 0 which means for every 6th record.

thanks,

Abd-Al-Aleem