cancel
Showing results for 
Search instead for 
Did you mean: 

Addition problems in the smartform

Former Member
0 Kudos

Hi,

I have designed a smartform which has a table in the main window. The driver program for the smartform is standard and not a custom development. This table displays 50 entries spanned out in 5 pages. At the end of every page i am adding all the currency values in the table on that page in the Footer.

Problem : On debugging i found that, 10 line items are coming into the Main Area of the table but while displaying only 9 are getting displayed . The 10th line item on the first page is displayed as the first line item into the next page. Due to this the addition that i do for the values on the first page is incorrect.

This is happenning on all the further pages as well...

Ne suggestions ???

Thanks

Nayan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

well thats how it works

system tries to print line item 10, senses that it doesnt have enough space left on page, and then make the page break. So the 10th line item in your case still counts to page 1 even if its finally printed on page 2.

what you could do when calculating your values is to check if your line item will still fit on the page. if so, then add it to you sum, if not, then remeber it for your sum for next page.

Former Member
0 Kudos

Hey Florian,

Thank you so much for the reply.

" what you could do when calculating your values is to check if your line item will still fit on the page."

How do i check this ???

Cheers

Nayan

Former Member
0 Kudos

hmmm lemme think about this, i know there is hiding some easy solution for this, i´m just not able to catch it...

you main window has a certain size, no matter in what unit you defined it there are just a certain amount of lines fitting on it.

you could count up a variable with every line printed in main window. Just be sure to reset this variable at page break.

then when calculating you sum, from actual line item, you could compare the rest of the window (Line size of window - number of used line ) against the number of lines a line item need to print. Hopefully you dont have line item texts and such which make line item line size dynamically.

But still even if this works i suspect it should work somewhat easier.

i just dont have another idea at the moment, but i will come back as sonn as i have another idea.

Former Member
0 Kudos

Hey,

Even i had though of this, but the problem is the table displayes Products and their descriptions. It may happen that the description would be just a line..or it may also happen that it contains text spanning 5 lines. This would be a problem then. Not able to come up with anything to solve this.

Im so bugged of this issue now.

Neways thanks for the solution. Do let me know in case any idea clicks.

Thanks

Nayan

Former Member
0 Kudos

still not clicked, BUT you could read your descriptions (i hence we are speaking of configuration) in forehand (in your smartform) so you know how much lines your actual line item would take but still i dont really like this approach.

Former Member
0 Kudos

yeah...not the best things to do

Former Member
0 Kudos

Hi Narayan,

are you calculating the total sum in the same window where you are displaying the items

or some other window

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Nayan Kurup,

If you cannot change the height of the main window, Decrease the Font size so that it will

print all 10 items in the each page.

Regards,

Jaya rama kumar

Former Member
0 Kudos

hi,

there are two posibilities one is Adjest the main window

2nd one is write the condition

use this code

if count => 10 .

clear count .

new page .

else .

count = count + 1 .

endif.

Former Member
0 Kudos

have u checked the size of your main window......may be the main window is not big enough to accomodate 10 records