Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SmartForms Loop Problem

Former Member
0 Likes
1,616

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 SequenceQty
12
23
31
41

Sum should be 7

next page

Record Sequence
Qty
11
22
34
41

Sum Should be 8

Last Page

Record Sequence
Qty
14
21




Sum should be 5

please send me how can i reach to this solution

8 REPLIES 8
Read only

vinoth_aruldass
Contributor
0 Likes
1,351

in your logic you should use page break concept .

google for smartform page break many documents available.

hope it helps,

Vinoth.

Read only

Former Member
0 Likes
1,351

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

Read only

former_member195270
Active Participant
0 Likes
1,351

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.

Read only

Former Member
0 Likes
1,351

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.

Read only

Former Member
0 Likes
1,351

Hi Nelson,

     follow this thread Re: SMARTFORMS Using tables  where i already explained the process...

Hope your problem will be solved....

Regards

Sabyasachi

Read only

Former Member
0 Likes
1,351

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.

Hope it serves your problem.

Read only

Former Member
0 Likes
1,351

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

Read only

Former Member
0 Likes
1,351

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