I have a crystal report which has a running total field, i want to look what is the formula that running total field is using? I have never used crystal reports am debugging with that now.
In other words how do i edit existing running total fields?
On the left hand side of the screen should be the Field Explorer. In that list is a group called 'Running Total Fields'. If you expand that list you'll see all running total fields for a report. If you right click one of those fields one of your options is 'Edit'.
The edit box has a whole bunch of different options. Summarizing a field by sum, or average, or minimum, maximum, etc. etc. etc.
You can also just find where the running total is being used in the report and right click the field its self to bring up the 'Edit' GUI.
If you're asking about code at a deeper level than this GUI, that is not revealed to the end user outside of this GUI/Wizard style format.
Related
I am trying to sum all the column value and want to display a summary. I am choosing Insert -> Summary -> Column name and Sum.. But rather then showing sum it is counting the rows and displaying the rows. Kindly please suggest some solution. I am available here if some one need for more info to help please comment. (Sap Scn Crystal Report)
Are you sure you are selecting the sum option from the summary?, because normally this should have returned the sum of the values. As an alternative you can use a Running Total Field.
From the Field Explorer window, right click on the "Running Total Fields" and select "New".
In the window that will appear, on the left side you will see the available tables and fields. From there select the field that you want to sum up and press the top ">" button.
As a type of summary select "sum", type a name for the "Running Total Name:" and press OK.
Drag and drop the new Running Total Field on a section of your report.
In Crystal Reports, what is the difference between a running total field and a summary field?
(In the Crystal IDE, Summary fields are located in Insert -> Summary. Running totals can be added in the Field Explorer)
(Version 11.5)
In my experience, Running Total fields are basically enhanced Summary Fields.
Running Total fields can do everything Summary Fields can, except that Running Total fields can also do the following:
Evaluate for each record, on change of field, on change of group, or evaluate based on a formula.
Reset the summary on change of field, on change of group, based on a formula, or never.
Summary Fields, however, can be shown as a percentage of a field, so they're not without their uses (and they're a little easier to set up).
In some inherited code, I see group headers/footers have items like 'Sum of #numcount' . I cannot get the sum of a formula field. Any thoughts?
The only reason that I know of why a formula wouldn't be available to summarize on is if it didn't reference any database fields or whose value wasn't dynamic throughout sections of the report. For example, if you have a formula that returns a constant it won't be available. Or if it only references a field that is set throughout the report and returns a value based on that field, like "if {parameter}=1 then 1" would not be available either.
In general, the formula's value should not be static through the sections of the report you're summarizing over (Though the way Crystal determines this is beyond me and this doesn't seem to be a hard and fast rule)
EDIT: One other reason why a formula wouldn't be available is if you're already using a summary function in that formula. Only one level of summaries at a time!
(Assuming you are looking at the reports in the Crystal Report Designer...)
Your menu options might be a little different depending on the version of Crystal Reports you're using, but you can either:
Make a summary field: Right-click on the desired formula field in your detail section and choose "Insert Summary". Choose "sum" from the drop-down box and verify that the correct account grouping is selected, then click OK. You will then have a simple sum field in your group footer section.
Make a running total field: Click on the "Insert" menu and choose "Running Total Field..."*** Click on the New button and give your new running total field a name. Choose your formula field under "Field to summarize" and choose "sum" under "Type of Summary". Here you can also change when the total is evaluated and reset, leave these at their default if you're wanting a sum on each record. You can also use a formula to determine when a certain field should be counted in the total. (Evaluate: Use Formula)
You Can simply Right Click Formula Fields- > new
Give it a name like TotalCount then Right this code:
if(isnull(sum(count({YOURCOLUMN})))) then
0
else
(sum(count({YOURCOLUMN})))
and Save then Drag and drop TotalCount this field in header/footer.
After you open the "count" bracket you can drop your column there from the above section.See the example in the Picture
You can try like this:
Sum({Tablename.Columnname})
It will work without creating a summarize field in formulae.
I have a problem with running Total in Crsystal report9
if their is no values available for a Paticular field how can we return the running total as '0'
Instead of display the Running Total directly in your report create a Formula Field based on the Running Total and drag it into the report.
Your formula should look like this (Crystal Syntax)...
if ISNULL({#RunningTotalField}) then
"0.00"
else
ToText(RunningTotalField, 2)
If there is no data for that particular group, then Crystal won't show it easily. Your options are :
1) Use subreports to display the values for a particular group, and keep the main report just looking at the table(s) containing the group headers.
2) Use a stored procedure as the source so you have full control over the SQL that is run.
The problem is that as soon as you use a field to group, Crystal will only return records where that field has been used. If it was simply in the Details section you could modify the link to a LEFT JOIN and it wouldn't matter, but the group forces the INNER JOIN which means the groups without data are not returned.
Unfortunately Running Totals don't show up if there are no records that match your criteria. An alternative is to use a set of formulas calculated in various sections of the report. The technique is widely described in the Crystal literature. For example, this TekTips gives a very succinct overview of your options.
You set up an initialising formula in each header, with the evaluation time directive "WhilePrintingRecords". This approach was the only one available for doing running totals in the "good ol' days" before RunningTotal objects were available.
suppose if i have many locations like L!,L2,L3 etc
each location hasAmount column with many records
how
can i totl the amount of each location in Crystal report
You need to create a Group for the Location, and then add a total field for SUM of Amount.
If you need me to explan the steps for you, please feel free to ask.
On the menu click Report and then
Group Expert.
A new window will pop up called
Group Expert with 2 boxes (Available Fields and Group By) and
buttons to move fields from left to
right.
Move the Location Field to the Group
By box and click OK.
Now you report should show a Group
Header 1 containing a field *Group1 Name* and Group Footer 1 which should be blank.
Now on the menu click Insert and
Summary. You should see a new window called Insert Summary.
In the Choose the field to
Summarize, change the field to the required Amount field to be summed.
Change the Calculate this summary
from Maximum to to Sum.
Change the Summary Location from
Grand Total(Report Footer) to Group #1 and click OK.
That should be about it. Now you can play around with the formatting as required.