Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#790494
Hello All,

We have a process which has 7 check boxes. If user clicks on a check box appropriate sub form will be displayed. So, for 7 check boxes we have 7 sub forms.

End users wants the print option, which should be in single page instead of 3 pages.
We can reduce this by using Output Document by giving the link of generated PDF inside the dynaform.

But the problem is 7 check boxes. User can select all the 7 if they want. They can select 1 or 2, or all 7. Based on this we have to generate the output document.

If i give all the fields of 7 subforms in single Output Document, print page will come upto 4. If we want to give more Output Document the probability will be 7. Combination will be high and we need to create more Output document.

So please advise us, how to proceed.

Regards,
Jenifer
User avatar
By amosbatto
#790512
You can create a case variable with the content of your subforms to insert into the Output Document.

For example, if your Output Document has this template:
Code: Select all
Here is text.
@#subformsContent
Here is some more text.
Then, in a trigger which is executed after the DynaForm, you can fill the @@subformsContent variable with the HTML content to insert in the Output Document. For example:
Code: Select all
@#subformsContent = '';
//check for one variable from the DynaForm to make sure that the user submitted it:
if (!isset(@=showClient)) {
    throw new Exception("You did not submit the DynaForm X.");
}
//subform 1
if (@=showClient == array(1)) {
   @#subformsContent .= '<p>Client Name: '.@@clientName."<br>\n".
        'Client Address: '.@@clientAddress."<br>\n".
        'Client Type: '.@@clientType_label."</p>\n";  
        //remember to use @@variable_label for dropdowns, suggest boxes, radiogroups & checkgroups
}
//subform 2
if (@=showAccount == array(1)) {
   @#subformsContent .= '<p>Account Name: '.@@accountName."<br>\n".
        'Account Type: '.@@accountType_label."</p>\n";  
}
//do the same for the other subforms
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]