Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

Newbie question about subforms

Avatar

Level 2

Hi all,

First of all, apologies for my english. It's really difficult for me trying to explain what I'm going to explain with this "macaroni english" I'm speaking. I beg your understanding. Well, let's go. I'm an educator and I'm am doing my first form intended to my colleagues for avaluation purposes inside my school. It's a fillable PDF. I'm stucked with a (I guess) rather simple thing. We have a lot of students, some of them pass the course and some of them fail. We need to do an individual report for every student who has failed in our class. But I have let's say 3 failed students and any of my colleagues maybe have 7 failed students.

I (think I) need to create a subform in the main form I'm designing with this behavior:

(Numeric field) Number of failed students: X

(and now, I want that a x number of subforms will open, 1 for each student with the usual fields)

Student 1.

Name

Grade

Problems detected

Possible solutions

...

Student 2

...

Student X

(end of subform).

I hope you understand what I need. How can I do this?

Thanks in advance.

Enrique Llorens

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

I've attached a sample of what I think were looking for.

The basic code behind this form generates "x" number of additional instances of the studentDetails subform for each student you require a record for (the code is in the exit of the students field).  The main form itself is "flowed" which allows the form to grow in size, the PDF is saved as a Dynamic PDF which indicates that the look of the document can change dynamically at runtime, and the sub-form has been set to allow it to repeat as many times as required in the binding tab of the object.

View solution in original post

3 Replies

Avatar

Correct answer by
Former Community Member

I've attached a sample of what I think were looking for.

The basic code behind this form generates "x" number of additional instances of the studentDetails subform for each student you require a record for (the code is in the exit of the students field).  The main form itself is "flowed" which allows the form to grow in size, the PDF is saved as a Dynamic PDF which indicates that the look of the document can change dynamically at runtime, and the sub-form has been set to allow it to repeat as many times as required in the binding tab of the object.

Avatar

Level 2

Thanks a lot. It's perfect

Enrique

Avatar

Level 2

Hi again,

I said that your subform was perfect, but doesn't work as well as I expected. I copy/pasted your subform to my form and changed captions and format to adapt it to my needs, but the result doesn't work perfectly. I expected that, if the number of failed students was more than one, the script would generate more of 1 instances of the subform, "pushing down" the rest of the form for making room to the instances. But this doesn't happen. Instead, it only creates 1 instance of the subform and in the # field the numbers 1,2 and so on are "crowded". I attach my original form because of my horrible explanation. Your code is implemented in the points 2.3 and 2.4 of my form. Can you help me with this? Again, many thanks in advance.

P.S. Another thing I can understand is how can I get rid of the first blank pàge in the form. I created a master page, but I don't want to see it in the final presentation of the form. Thanks!

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----