Manual Group Totals Corrupting
I am using an application that uses Crystal Reports 7 runtime for reporting. My reports are designed using Crystal Reports 8.5 Standard, then saved in version 7 format.
I have a couple of reports that display a range of orders from dBase databases. Each order is defined as a group header, with a manual subtotal initialized and zeroed in the header, a value added in the detail, and the total displayed in the Order footer.
All of this is done as per the techniques shown many time in this forum, using Shared NumberVar etc...
Yet the total are being corrupted part way through the reports with no apparent cause.
I have checked this to death, confirmed every value at every stage, yet the total results in no meaningful figure - in fact it seems ok part way through, then just decreases with no apparent cause.
Are there any know bugs in the the Crystal 7 runtime that relate to this?
Can I upgrade the runtime components without the main application being modified? (We no longer have a support contract)
Are there any alternative methods for totalling?
Any suggestions appreciated.
Nigel
It would have helped if you had supplied the formulas but here's a guess
Check in the group options to see if you have "Repeat Group Header on Each Page" switched on for your group. If you have then you the reset formula i the group header should only reset for the first instance so you will need to check this with
If Not InRepeatedGroupHeader Then
// reset your variables here
HTH
Similar Messages
-
Manual Running Total vs Running Total
Morning all,
It is some what strange to me when I try to use a formula to calculate the total jobs and when I try to use Running total to count the same total jobs. Both answers in theory should be the same however they are not. I am wondering where am I going wrong in the manual formula.
If {despatch_summary.job_type}="FSV" then
if {despatch_summary.order_status}<>0 then
{despatch_summary.order_no}
else
0
The above code then gets DistinctCount ({@FSV})
The same method if I use by using Running Total it gives the correct number of jobs.
Running Total
field to summarize : despatch_summary.order_no
Summary Type: DistinctCount
Formula: {despatch_summary.job_type}="FSV" and {despatch_summary.order_status}<>0
Reset: none
The formula gives me 513 where as the same running total gives me 514
Where am I going wrong?
Strangely it is adding 1 to all of my manual running totals (1 is coming from canceled orders).
Many thanks
RegardsSastry I am adding this formula into the crosstab which is setup by Number of days. So on the column it is number of days and on the summarized field it is this formula.
I chose Group options and clicked on DistinctCount after adding the formula into the summarized field.
I have already tried the formula you have suggested however it doesn't seem to be affecting it.
Apart from that what I have just done is added the Running Totals to the Summarized field which is coming up correctly however now the problem is to get their percentages.
I have used the following code but it doesn't seem to be working.
Whileprintingrecords;
Numbervar g:=Currentfieldvalue;
Numbervar h:={@TotalJobs-CanceledJobs};
Numbervar i:=0;
i:=((g/h)*100);
Numbervar gTot:=gTot+i;
if gTot > 100 then "100.00%"
else
totext(gTot,2)+"%"
I know I am doing it wrong when it comes to percentages. I need to get the percentages off that Running Total (Grand Total).
Am not sure how to acheive that either.
Many thanks
Regards
Jehanzeb -
Manual Running Total won't Reset
I've created the following formulas to create a manual running total. However, I can't get the total to reset. Instead, the total gets added to each time the group appears. What am I missing?
GROUP 1 HEADER
================
//placed this in group 1 header to reset total each time this group appears
whileprintingrecords;
shared currencyvar TotalCore;
TotalCore:=0
GROUP 2 FOOTER
============================
//placed this in the footer of next group to get total added to the TotalCore variable from above
//the fields I'm adding to TotalCore are fields summarizing the detail fields
WhilePrintingRecords;
Global CurrencyVar TotalCore;
TotalCore := TotalCore + ({@Core6-Sum} + {@CoreApp3-Sumfor#ofMos});
TotalCore
GROUP 1 FOOTER
============================
//this number accumulates for each group...I need it to reset.
WhilePrintingRecords;
Global CurrencyVar TotalCore;
TotalCoreYou left out two extremely important pieces of information: the formulas for {@Core6-Sum} and {@CoreApp3-Sumfor#ofMos}. It is possible (from where I sit) that they are carrying the values forward...
Other than that, I don't see anything obviously wrong...
HTH,
Carl -
Hello All,
I have written manual running total formula:
Reset formula in group header:
whileprintingrecords;
numbervar sol:=0;
Evaluation formula in detail section
whileprintingrecords;
numbervar sol;
if Field_Name1 <> previous(Field_Name1) then
sol:= sol+ Amount;
Display formula in group footer;
whileprintingrecords;
numbervar sol;
But the total doesn't seem to match, can someone help me!
Thanks!
SonaliHi Sonali,
For Ex:
1) If the group is on County> U, and country has 40 detailed records.
2) The Option " Repeat group header on each page is checked" and a reset formula is placed in the
group header.
3) In one page take for example 25 detail records are printed the evaluation formula will evaluate for 25
records. And in teh next page again the group header will be printed. This causes the reset formula
to print again where the total becomes zero again. And the remaining 15 records will be added and
the group footer will display that total.
Regards,
Vinay -
Calculate % on manual running total??
I have a three part manual running total that prints the final value in the report footer. That total is based on groups of cities and time spent by each city on a project. I'm trying to calculate the percentage of time they spent on the total project in each cities group footer. So, of course (citytime % totalprojecttime). However, since it's a manual running total it's calculating based on the time up until that point, so the first city is always at 100% because the manual running total and time spent by that city is always equal. Then the next percentage is only based on the first two cities total divided by that current city, etc. so that the only city that actually has a correct percentage is the last one because it's finally calculated the totals at that point.
I've tried various printing states (evaluate after, etc) but those aren't going to work because the total isn't done until the end. Without doing a subreport, is there anyway to calculate that properly?If you can't do a simple summary to derive total time for City, then you will need to develop a hidden subreport which you place in city group header, and use that total calculate total city time. You can then use a shared variable to holding the total city time to calculate your %ages.
Hidden subreport is a subreport will all sections suppressed and minmised so that it does not appear, it must be held in an unsuppressed section, you can section to underlay to ensure minimum space taken up.
Ian -
Hello freinds,
What will we do if current log group is corrupt ( archivelog and noarchivelog)?
RegardsNo, there are cases when archiver couldn't archive the redo log. Then you have to use UNARCHIVED. But then you should perform a backup asap because you cannot fully recover your database.
This command isnt for the current group because you cannot clear it. These logfile group information are needed for instance recovery. If you could clear the current logfile group, after a crash your instance would be in a inconsistence state and oracle does't have enough information to make it consistence. I posted this command because I overread the word "current" in your post.
>
Total Questions: 139 (98 unresolved)
>
and please mark your posts as answered and helpful/correct...
HTH..
- wiZ -
Hi,
I have sql query which gives output of accounts and balance.
I have designed report to show chart of accounts and their balances.
How can I take group total fields to show sum of each level of accounts.
Level
Account
Header 3
Header 4
Header 5
Header 6
Header 7
1
Revenue
2300
2
Direct Income
300
3
Sales
300
4
Sales
300
5
In Store Sales
100
5
Online Sales
200
2
Indirect Income
2000
3
Interest
1100
4
Bank Interest
1100
5
Bank Interest A
400
5
Bank Interest B
700
3
Other Income
900
4
Other Income
900
5
Other Income
900
In my reports I have taken all the accounts and balances in five detail sections.
I want to create formula to show level wise addition of account balances.
Please reply.Thanks.Hi,
Try this code
{Level}=1 then {Header 3}
else if {Level}=2 then {Header 4}
else if {Level}=3 then {Header 5}
else if {Level}=4 then {Header 6}
else if {Level}=5 then {Header 7} -
How to get the group totals in report
HI,
Iam generating a report to display Storage Location, and Unit of Measures and Material group and also group totals.
how to display the group totals on the report.
thank q
rushi.Hi,
This following report clearly explains how to display the subtotal and grand total of
the particular field in alv.
REPORT YMS_ALVSUBTOTAL.
*REPORT z_alv_sub_totals .
TYPE-POOLS: slis.
DATA: BEGIN OF it_output OCCURS 0,
var1(8) TYPE n,
var2(10),
var3 TYPE I,
END OF it_output.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
t_fieldcat TYPE slis_fieldcat_alv,
it_sort TYPE slis_t_sortinfo_alv,
t_sort TYPE slis_sortinfo_alv,
v_repid LIKE sy-repid.
INITIALIZATION.
v_repid = sy-repid.
START-OF-SELECTION.
PERFORM get_data.
PERFORM sort_fields.
PERFORM fill_fieldcat.
PERFORM list_display.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
FORM get_data.
it_output-var1 = 1000.
it_output-var2 = 'anupama'.
it_output-var3 = '10000'.
it_output-key = 'X'.
APPEND it_output.
CLEAR it_output.
it_output-var1 = 1000.
it_output-var2 = 'siddhu'.
it_output-var3 = '20000'.
APPEND it_output.
CLEAR it_output.
it_output-var1 = 1000.
it_output-var2 = 'chinni'.
it_output-var3 = '100000'.
APPEND it_output.
CLEAR it_output.
it_output-var1 = 2000.
it_output-var2 = 'chicchu'.
it_output-var3 = '10000'.
APPEND it_output.
CLEAR it_output.
it_output-var1 = 2000.
it_output-var2 = 'candy'.
it_output-var3 = '10000'.
APPEND it_output.
CLEAR it_output.
it_output-var1 = 1000.
it_output-var2 = 'anupama'.
it_output-var3 = '10000'.
APPEND it_output.
CLEAR it_output.
it_output-var1 = 4000.
it_output-var2 = 'anupama'.
it_output-var3 = '10000'.
APPEND it_output.
CLEAR it_output.
ENDFORM. " GET_DATA
*& Form fill_fieldcat
text
--> p1 text
<-- p2 text
FORM fill_fieldcat.
PERFORM fill_fields USING: 'IT_OUTPUT' 'VAR1' 'Variable 1' ' ',
'IT_OUTPUT' 'VAR2' 'Variable 2' ' ',
'IT_OUTPUT' 'VAR3' 'Variable 3' 'X'.
ENDFORM. " fill_fieldcat
*& Form fill_fields
text
-->P_0146 text
-->P_0147 text
-->P_0148 text
-->P_0149 text
FORM fill_fields USING value(tabname) TYPE slis_tabname
value(fieldname) TYPE slis_fieldname
value(seltext_m) LIKE dd03p-scrtext_m
value(do_sum) TYPE c.
t_fieldcat-tabname = tabname.
t_fieldcat-fieldname = fieldname.
t_fieldcat-seltext_m = seltext_m.
IF do_sum = 'X'.
t_fieldcat-datatype = 'CURR'.
ENDIF.
t_fieldcat-do_sum = do_sum.
APPEND t_fieldcat TO it_fieldcat.
CLEAR t_fieldcat.
ENDFORM. " fill_fields
*& Form list_display
text
--> p1 text
<-- p2 text
FORM list_display.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
it_fieldcat = it_fieldcat
it_sort = it_sort[]
TABLES
t_outtab = it_output
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " list_display
*& Form sort_fields
text
--> p1 text
<-- p2 text
FORM sort_fields.
t_sort-fieldname = 'VAR1'.
t_sort-tabname = 'IT_OUTPUT'.
t_sort-spos = 1.
t_sort-up = 'X'.
t_sort-subtot = 'X'.
APPEND t_sort TO it_sort.
CLEAR t_sort.
t_sort-fieldname = 'VAR3'.
t_sort-tabname = 'IT_OUTPUT'.
t_sort-spos = 2.
t_sort-up = 'X'.
APPEND t_sort TO it_sort.
CLEAR t_sort.
ENDFORM. " sort_fields
Thanks,
Sankar M -
Weekly Group Total and associated YTD total
Hello,
I need to show current week group total and total year to date of the same group. My columns are Model, Department, Issue. Currently, the report is grouped on Model, Department and Issue with a filter for date. Can this be done? Thank youCreate a formula field, say {@Current Week Amount} as (basic syntax):
if datepart("ww", {datefield}) = datepart("ww", CurrentDate) then
formula = {amount}
else
formula = 0
end if
You can then sum() this, or place it in a detail line, or whatever. It will only have a (non-zero) value when the date field is in the current week.
HTH,
Carl -
Incrementing Total not correct(adding +1) in some group totals
Hi All,
I have an incrementing total that appears to work fine except when I try to display the total's final count only SOME groups have a +1 count. There doesn't seem to be a logical reason for it.
Any ideas?
Incrementing total formula:
Whileprintingrecords;
if Not({Command.BI_UPD_DT_TM} > {@f_ConvertRevYrMo_DtTm})
then
Global numbervar memberlinecnt := memberlinecnt +1
else
memberlinecnt+0;
Formula to call incrementing total's final group total:
Global numbervar memberlinecnt:={@f_RRTMemberIncrement};
memberlinecnt;
Note: I've not been able to use Running Total fields with this report because I need to evaluate totals based on group criteria and there are multiple groups and criteria.Hi Sharon,
I do have a reset, just didn't include it in my post.
Reset
//@Reset (Place this in the group header section suppressed)
WhilePrintingRecords;
Global NumberVar memberlinecnt:= 0;
Like I said,the whole thing appears to work, counting for ever group, resetting; except for only some groups, the total is +1 of the total. I don't know why.
Thanks,
John -
Help with Formula/Placeholder columns for group totals
I have select that is broken into 2 groups (a COMPANY group and a DETAIL group within company). I need to determine the COMPANY group totals based on values in a column in the DETAIL group. I.E. the column is a transaction description and can have up to 15 different values and it did not appear that a summary column would work for what I need. I have currently set up 15 formula columns in the DETAIL group and check the value of the REASON to accumulate totals and return the total to a PLACEHOLDER column (which is numeric and defined in the COMPANY group).
I then report the Placeholder columns at break of COMPANY. This all works fine if I run only one company. If I run with multiple companies the Placeholder columns are used as a running total.
My question is how do I reset the PLACEHOLDER columns at company break if at all, or is there a simpler way to accomplish what I need.
Any and all assistance would be greatly appreciated.
Tom VereeckeIf you are using one placeholder column in different formula columns just ignore the following solution. It will not work in that case. I will post it here if i find out any way to initialize placeholder columns at different groups or anyother way to solve this issue.
I think if you remove placeholder columns and create summary columns at Company Level, that will work. And formula columns will be changed as follows:
Formula Column:
active_total number(10) := 0;
begin
if :status_1 = 'ACTIVE' then
active_total := active_total + 1;
end if;
if :status_2 = 'ACTIVE' then
active_total := active_total + 1;
end if;
if :status_3 = 'ACTIVE' then
active_total := active_total + 1;
end if;
return active_total;
end;
And in summary columns source will be formula columns. And reset the summary columns at Company.
Hope this helps.
Message was edited by:
fs -
Group totals summary in another group summary section
I have a report requirements that need to re-display the group total in a summary section. Please see below simple example. The second summary does not have fixed number of Units, it depends how many units are in each Department.
I am not able to reproduce the department summary. Is this possible in SSRS, I can do this in crystal?
Example:
Department ABC Unit 100
details line here....
Unit 100 totals here
Unit 120
details line here.....
Unit 120 totals here
Unit 140.......
Department ABC summary
Unit 100 total
Unit 120 total
Unit 140 total
Department XYZ
Unit .................
Department XYZ summary
unit totals.................... (one to many)
Final Summary
Department ABC total
Department XYZ total
Jim PanHi Jim,
In your case, we can work around the issue in SSRS. Suppose we have a dataset (DataSet1) include following fields: Department, Unit, Amount. Please refer to the following steps:
Add a table in the report body. Please refer to the table structure below:
Parent Group: Department
Child Group: Unit
Data: Amount
Click the blank arrow of (Details) in the Row Groups dialog box. Click Add Total.
Use the same method add total to the Unit and Department group.
There is a screenshot for your reference:
If you have any questions, please feel free to let me know.
Regards,
Alisa Tang
Alisa Tang
TechNet Community Support -
MVER table - Manually corrected total consumption
I am trying to determine total and manual corrected consumption based on the tables MSEG & T156 instead of using MVER.
Could someone please explaine me how is the value of the field 'Manually corrected total consumption' determined in the table MVER.Hi,
The below will help you in understanding the behaviour . Please check the same in such a way and please post back.
http://scn.sap.com/thread/1789094
Regards, -
Urgent : how I get tree type group total result
hi master
sir now system give me this type for result
PARENT ACCID DRBAL CRBAL
K1
K11
11 K1101 46291132
11 K1102 13182173
11 K1103 23784045
11 K1104
11 K1105
11 K1106
11 K1107 10001795
11 K1108 9083529
11 K1109
11 K1110 4224350
11 K1111
11 K1112 6696832
11 K1113 7963381
11 K1114 742766
1 K12
12 K1201 1486082
12 K1202
12 K1203
1 K13
13 K1301
1301 K130101
1301 K130102
1301 K130103
1301 K130104 1977616
1301 K130105
1301 K130106 736266
1301 K130107 396673
1301 K130108 42751
1301 K130109 298362
1301 K130110 187696
1301 K130111 537
1301 K130112 942
1301 K130113 987
1301 K130114 1272
1301 K130115 40000
13 K1302
1302 K130201
1302 K130202
1302 K130203
1302 K130204
1302 K130205 259941
13 K1303
1303 K130301
1303 K130302
1303 K130303 177716
13 K1304
1304 K130401
1304 K130402
1304 K130403
1304 K130404
1304 K130405
1304 K130406 809719
1304 K130407
1304 K130408 1786091
13 K1305
1305 K130501
1305 K130502
13 K1306
1306 K130601
13 K1311
1311 K131101 788780
K2
2 K21
21 K2101
2101 K210101
2101 K210104
21 K2102
2102 K210201
2102 K210202
22 K2205
2205 K220501
2205 K220502
220502 K22050201
220502 K22050202
220502 K22050203
220502 K22050204
22 K2206
2206 K220601
2206 K220602
but sir i need this type of result
PARENT ACCID DRBAL CRBAL
GROUP NAME K1
GROUP NAME K11
11 K1101 46291132
11 K1102 13182173
11 K1103 23784045
11 K1104
11 K1105
11 K1106
11 K1107 10001795
11 K1108 9083529
11 K1109
11 K1110 4224350
11 K1111
11 K1112 6696832
11 K1113 7963381
11 K1114 742766
TOTAL
1 K12
TOTAL
GROUP NAME
12 K1201 1486082
12 K1202
12 K1203
TOTAL
1 K13
13 K1301
1301 K130101
1301 K130102
1301 K130103
1301 K130104 1977616
1301 K130105
1301 K130106 736266
1301 K130107 396673
1301 K130108 42751
1301 K130109 298362
1301 K130110 187696
1301 K130111 537
1301 K130112 942
1301 K130113 987
1301 K130114 1272
1301 K130115 40000
13 K1302
1302 K130201
1302 K130202
1302 K130203
1302 K130204
1302 K130205 259941
13 K1303
1303 K130301
1303 K130302
1303 K130303 177716
13 K1304
1304 K130401
1304 K130402
1304 K130403
1304 K130404
1304 K130405
1304 K130406 809719
1304 K130407
1304 K130408 1786091
13 K1305
1305 K130501
1305 K130502
13 K1306
Sir I need total group by group father group total and child group total
Please help me how I get tree type group total resultHi master
thankyou for your reply
Sir,
i know and you see my working i get code form master table and get detal amount form other table
I have two table see table
Acctab Baltab
PARENT PCID
CHILD title
PCID amount
I need heretical result use this type of query but not success
please see my query and give me idea how I get here full tree
select test.child,test.pcid,baltab.pcid from (select acctab.child,acctab.parent,acctab.pcid
from acctab
start with acctab.parent is null
connect by prior acctab.child= acctab.parent) test,baltab
where test.pcid=baltab.pcid ;
CHILD PCID PCID
1 1 1
2 2 2
3 3 3
11 111 111
12 112 112
13 113 113
21 221 221
22 222 222
23 223 223
31 331 331
32 332 332
33 333 333
but I need this type result
CHILD PCID
1 1
11 111
12 112
13 113
2 2
21 221
22 222
23 223
3 3
31 331
32 332
33 333 -
Add and subtract summary group totals
Looking for a way to add and subtract summary group totals in a report.
I have my data grouped by account type then summarized. Example
have my data grouped by account type then summarized. Example
acct. type amount
51 $100
51 50
Summary $150
61 $100
61 100
Summary $200
70 $50
70 50
Summary $100
Formula I want to make this formula 51+61-70 = GP
I am trying to understand how to put the acct. type(51,61) in the formula and insert in the report.
Thanks for the help.
Raald232
Maybe you are looking for
-
Custom tabular form error on apex_item id larger than 50
First post :) I'd like to share a potential bug in apex (3.0.1) or misconfiguration in our application server When creating a page with a custom tabular form, i've noticed that when i give a column an id over 50 (ex: "apex_item.text(51,salary) salary
-
How can I initialize a web application in a cluster
Our current test environment is a single node but we have to move to a clustered environment. We have some database initialization which we do using a 'startup servlet' with the load-on-startup marker. Now how does this behave in a clustered environm
-
Itunes will not open after installing lion and software updates
I just installed lion and completed the most recent software updates for my computer, now i cannot get iTunes to open without it "unexpectedly quitting" on me. Has anyone else had this problem or knows what to do?
-
Sunday evening and 'grabbing' photos off a .pdf document
How does one do that? I get a little gunsight cursor icon when I left click to copy a photo in a .pdf file. I have the latest version (9.4.1) of freeware, and am using Windows 7, all upgrades, on a new dual core with plenty of memory...........go f
-
Color settings between the Mini and Dell monitor
I got my new Mac Mini Intel Solo yesterday and hooked it up to my Dell 20" widescreen flat-panel. As soon as my screen popped up, the color scheme was waaaay off. It was too red. So I messed with all different kinds of color settings on the monitor i