AnsweredAssumed Answered

multiple records per ID, save each to PDF

Question asked by techxedu on Jan 15, 2017
Latest reply on Feb 5, 2017 by techxedu

Greetings!

 

Having difficulties saving a "multiple record per student" layout into a separate PDF report for each student. Works well creating one huge PDF when "saved as PDF" from the preview mode but I also need to parse out the PDF to each student and that is where I would like to automate and having trouble. Here's what I have setup thus far:

 

1) Table has multiple records per student

 

2) Layout has these parts defined in the layout:

- "sub-summary (leading)" with page break before occurrence ... this part has report title, student name, etc;

- "body" part shows multiple records per student;

- "sub-summary (trailing)" has a calculated fee total per student;

- "trailing grand summary" shows grand total of all student fee summed up;

- "footer".

 

The current script looks like this:

Go to Record/Request/Page [ First ]

Loop

Set Variable [ $IDStudent ; Value:Table::STUDENTID ]

Set Variable [ $NameFamily ; Value:Table::LAST ]

Set Variable [ $PDFFileName ; Value:$IDStudent & " " & $NameFamily" & ".pdf" ]

Set Variable [ $DesktopPath ; Value:Get(DesktopPath) & "Folder1" & $PDFFileName ]

Go to Related Record [From table: “Table”; Using layout: “consolidated report” (Table) ] [ Show only related records ; Match found set ]

Save Records as PDF [ File Name: “$DesktopPath” ; Records being browsed ] [ Restore; No dialog ]

Go to Record/Request/Page [ Next; Exit after last ]

End Loop

 

When the script is run, it creates a separate PDF for each student but the content is all the same the consolidated report and not only that sutdent's report shown in the file name. Which makes me think that it is properly looping and picking up the student name to create the unique file name of the PDF but I must be missing a command and/or the options for the "Go to Related Record" or "Save Record as PDF" are not quite right.

 

Any help/pointers/advice will be greatly appreciated. Thank yoU!

Outcomes