on 12-02-2010 1:36 PM
Hi,
can anyone let me know how to calculate subtotals when data is being displayed in the MAIN AREA of a TABLE(not on a window).
and also please let me know how to calculate TOTALS seperately for each page when data being displayed in the MAIN AREA of a TABLE.
I have already looked into SF_TOTALS and SF_SUBTOTALS report but was not able to make out the logic.
Thanks,
BJR.
The smartform logic is pretty straightforward...there's a simple code node in one cell in the main loop processing that collects row values into a global table. The sort events (indicated on the Data tab) are used to output the subtotals (within a LOOP node).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks to Brad,Sumit and Suvajit for your valuble replies
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
First calculate the total number of records to be displayed in smartform.(ex:- w_record).
Now,Declare a table in the main window.Go to Calculation tab in the table and do the followings.
Operation: Total
Field name: name of the field on which you want to take totals or subtotals
Target Field Name:w_total
Time: After Loop.
Now go to the footer part of the table create a rowtype.and create two text under it and rename it.(say-Pagetotal and Grand total).
Under the pagetotal text you can find general attribute tab.Right the following:
Page total :&w_pagetot&
and then go to condition tab.Write w_record NE w_line.(It means when the number of lines in each page not equals to number of records the page total will be print).Here w_line is a variable of I which will be increased per record.
Do the same for Grandtotal text.
Under the pagetotal text you can find general attribute tab.Right the following:
Page total :&w_total&
and then go to condition tab.Write w_record EQ w_line.(It means when the number of lines in each page equals to number of records the total will be print).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can try using final window in smart form. This is mainly used to calculate totals & subtotals.
you have an option there to specify the field on which you need subtotal or total.
Hope this helps.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.