Expand my Community achievements bar.

Repeating table within a repeating table

Avatar

Former Community Member
I have table in a PDF with repeating rows. Within each row, they can further repeat. Everything works fine except I can't reference the inner most repeating rows. What seems easy has turned out to be a major frustration for me.



I've spent over 10 hours trying to figure it out and can not seem to figure out how to reference those rows. Can anyone please help?



Here is a small sample PDF that demonstrates the problem:

https://share.acrobat.com/adc/adc.do?docid=f2b8d504-aa88-4f6a-905a-f80fd87029ed



thank you
5 Replies

Avatar

Former Community Member
Hello Scott,

It's better to use Subforms instead of Table. You can manipulate subforms much more easy than tables.

Avatar

Former Community Member
I actually should have stated rows within rows, not table within a table, so actually, it's just one table.

Avatar

Former Community Member
Hello

Chenge Click script with this one



form1.P1.Button3::click - (FormCalc, client)

var countSect = form1.P1.Full_stay.f.resolveNodes("sect[*]").length

//xfa.host.messageBox(countSect)



for s=0 upto countSect-1 do

var countRooms = form1.P1.Full_stay.f.sect[s].resolveNodes("rooms[*]").length

//xfa.host.messageBox(countRooms)

for r=0 upto countRooms-1 do

form1.P1.Full_stay.f.sect[s].rooms[r].number.rawValue=Concat("Room #",r+1)

endfor

endfor

Avatar

Former Community Member
wow, that you so much Paul! I can't tell you how long I've struggled with this. thank you, thank you, you are a genious!



I've also learned that you can use resolveNodes in Formcalc, which I never realized that you could do. this will help in the future.



I've been trying to understand your new code and it appears to me that you really have to use resolveNodes because you really don't know what the array index would really be, but it is possible you could explain why it's not as simple as the rooms[] index ranging from 0 to 3 since that's all of the room rows that I had.

Avatar

Former Community Member
>I've been trying to understand your new code and it appears to me >that you really have to use resolveNodes because you really don't >know what the array index would really be, but it is possible you >could explain why it's not as simple as the rooms[] index ranging >from 0 to 3 since that's all of the room rows that I had.



Actually, I don't know why it gives those stupid ranges (smth like 7 ,22 , you can check it with messageBoxes), maybe it's because of you adding new instances of rows with script. If you will add them with XML datasources, it will be with normal ranges.