Former Member

# SmartForms Loop Problem

Dear Friends

I have an internal table and have 10 records inside it.

According to my requirement

I have to display only 4 records in one page and sum of those 4 records in end of the page

Like

Record SequenceQty12233141

Sum should be 7

next page

Record Sequence
Qty
11223441

Sum Should be 8

Last Page

Record Sequence
Qty
1421

Sum should be 5

please send me how can i reach to this solution

10|10000 characters needed characters exceeded

### Related questions

• Former Member
Posted on Jan 08, 2013 at 06:13 AM

Hi ,

Write the sum logic in footer and display the footer at page break...

after the page break clear the sum variable and allow the logic to calcutale sum again for the next page ..

again at page break display the footer..

Thanks,

Ben

10|10000 characters needed characters exceeded
• Posted on Jan 08, 2013 at 06:34 AM

Hi Nelson,

In global data create one variable (Ex:Count). In that table main area under the cell create one program line and increase counter by following the code,

`clear flag.count = count + 1.if count = 4.flag = 'X'.endif.`
10|10000 characters needed characters exceeded
• Former Member
Posted on Jan 08, 2013 at 06:10 AM

in your logic you should use page break concept .

google for smartform page break many documents available.

hope it helps,

Vinoth.

10|10000 characters needed characters exceeded
• Posted on Jan 08, 2013 at 06:27 AM

Nelson,

Create a new smart form as you normally create.

Inside main window write your logic for displaying records using Loop flow logic and then inside

loop use flow logic alternative and Alternative general attribute put condition for new Page.

If it is true then display toalal and use New Page comand for displaying page.

see attachment as sample.

smart.jpg (76.4 kB)
10|10000 characters needed characters exceeded
• Former Member
Posted on Jan 08, 2013 at 06:59 AM

Hi Nelson,

Hope your problem will be solved....

Regards

Sabyasachi

10|10000 characters needed characters exceeded
• Former Member
Posted on Jan 08, 2013 at 07:17 AM

Hi,

You can add a code logic node inside the table node and declare a counter. Then keep on incrementing the counter as long as the counter value is less then or equal to 4.Once its greater than 4 clear the counter variable.In the window add a condition with the check of counter variable greater than 4, do a page break then.

10|10000 characters needed characters exceeded
• Former Member
Posted on Jan 11, 2013 at 05:57 PM

Hi Nelson,

Please use Command option along with Program lines in Flow logic of smartform.

You will be able to proceed.

Please revert in case of issues.

Regards

Vivek

10|10000 characters needed characters exceeded
• Former Member
Posted on Jan 12, 2013 at 07:56 AM

Hi Nelson,

First Sort your records in the sequence you want to show and then use the COMMAND for page break.

Else

If the format is fixed of showing 4 records per page then design your main window in such a way that it accomodates only 4 records of the table.

Hope this helps.

Thanks,

Tooshar Bendale