Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running totals with vb.net

Status
Not open for further replies.

mkohl

Programmer
Feb 22, 2005
82
US
I have a problem I was wondering if someone could help me with.

Problem is I can't get a running total of each group item.

Exampe in my test database I have
data issues - total records 2
Work order issues - total records 1
Audits - total records 1

I need a running total so that it displays
Data issues 2
work order issues 1
Audits 1

in my report I have a graph that displays the correct totals. However, when I created a group named "Types" I can not seem to get a correct total.

I have tried creating a running total, and I played with some of the settings such as changed the summary to count, changed the evaluation for each record, and I have tried evaluation change of field, and I have also changed settings under Reset. But no matter what I do I can not get the correct total for data issues. I get totals such as 1,2,3 or 1,1,1 but never 2,1,1.

 
I'm not clear what the data is. Two records, one audit and one work order. Or four, including two 'data'?

You didn't mention using a formula to decide whether the running total should add or sum. This normally works: if you've tried this and it failed, please post your formula.

It also helps to give your Crystal version.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Sorry about misleading information.

I believe the version 8.1.

My Program: My program searches emails sent to me relating to why jobs are on hold. When the program finds an email relating to a job that has been placed on hold it saves the information into a database. There are several reasons why a job can be on hold few examples would be: Data Issues, Work Order Issues.

The Report: The reports generates a graph of why jobs have been placed on hold, so we can have a better understanding on the problems we are currently having. The report also shows a list of different Issues, along with the total of each issue. example

List
---------
Data Issues 1
Work Order issues 1

Problem: If I have 2 records in the database that have the vaue of "data issues" I do not get a correct total in my list. so if I have 2 records in the database with a description of "Data Issues", and 5 records in the data base with the description of "Work Order Issues" I should get a list such as the one below.

List
-------
Data Issues 2
Work Order Issues 5


I am currently grouping the description (table.description) and have created a running total field, however, my total running field is not working the way I would like it to work. I get values like 1,1 but not 2,5.







 
If you are grouping on description, your running total would be a count of {table.description} or any other recurring field, evaluate for every record, reset on change of group {table.description}. You MUST place the running total in the group footer, not the group header.

But, you probably don't need running totals at all. Place {table.description} in the detail section->right click->insert summary->choose count at the group level.

You could also place a crosstab in the report footer where you use {table.description} as the row field, and count of {table.description} as the summary.

The latter two solutions would work if you had no row inflation.

-LB
 
Thanks. I ended up grouping in the group footer, which works great. I think my problem must have been trying to do this in the header and detail section of the report.

Thanks!
-mk
 
I do have a new question about grouping totals. Thanks to everyones help I did get my problem solved and actually learned a few things about crystal reports.

However, even though this next question is not related to a problem I am having, I would like to understand more about why it would happen.

Situation: I have two different reports.
1. A report that shows a graph and group totals of the items populating in the database.
2. A list of all the records in the database.

Problem. On the first report, I have a group that displays total of each item(summery). The totals are displayed in the group footer of the report, and works great. On the other hand on report 2. If I do the same group footer, the information is displayed in the drill down and appears in the list(detailed) portion of the report.

I tried to display the group totals after the list, but no matter what I did. All the Group totals would be displayed in the detailed section. I wanted them to be displayed after the drill down grouped together towards the bottom of the page.

I decided just to go with a grand total in the page footer, but was wondering why (no matter what I tried) the totals would not display like the first report. I checked all the settings and everything seemed to be the same but the result was different.


 
I think you are using section names incorrectly--inserted group totals won't show up in a detail section. You would have to write a formula to do that.

It is unclear what you are trying to do. If you want a summary of all group totals to appear in the footer when you drill down on one group, you could insert a crosstab in the main report report footer (with your group field as the row, and your amount field as the summary) and then hide the section. Make sure that in file->report options-> you have checked "show all headers on drilldown".

-LB
 
This is a generic display of what my reports are dispaying:

report 1:

<top of page>
Chart (my chart)
<group footer>
Totals:
--------------
item1 total
item2 total
item3 total


Report 2:

<top of page>
column headings
<detail section> //which displays all items in my database
Item1 Total
item
item
item
Item2 Total
item
item
item
Item3 Total
item
item
item

This is kind of what I was looking for:
report 2:
<top of page>
Column headings
<details>
List all items from database
<group footer>
item1 total
item2 total
item3 total

Problem: I did the same on report1 and report2. I had my totals in the group footer. But, my previous question was why would they be displayed in the detail portion. It appears as if I did both reports the same. I checked the format of each section. I made sure my group was in the group footer.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top