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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summary report Method

Status
Not open for further replies.

smil3y

IS-IT--Management
Jan 8, 2004
79
0
0
AU
I have created a report in VB6 (using crystal reports 8.5). VB is passing a range of dates as parameters and the report is filtered according to these dates.
The report has three parts.

Part 1 provides a list of dates and distances covered by vehicles in groups.
The format is as follows:
Report Header - suppressed
Page Header - standard Header
Group Header - Groups the types of vehicles
Details - the dates and distances for each trip completed.
Group Footer - provides a sub total for the distances travelled by each vehicle in the group
Report Footer a -A grand total that sums the sub totals in the group footer.

Part 2 of the report provides details of purchases related to the vehicles. This information is provided in REPORT FOOTER B as a sub report.

Part 3 - I need to provide a summary of the sub totals that were provided in the group footer.

Assuming that the groups of vehicles are; CAR, BUS, 4WD. An example of how I want the data presented follows.

I have parts 1 and 2 working OK, but I am not sure of the best way to do Part 3. is there an easy way to produce the summary. Do I need another sub report.

DISTANCE REPORT
----------------------------------
CAR

1/2/2005 225
2/3/2005 150
5/4/2005 50

Sub Total 425

BUS

1/2/2005 200
3/3/2005 300
5/4/2005 400

Sub Total 900


4WD

4/2/2005 25
8/3/2005 100
9/4/2005 75

Sub Total 200

Grand Total 1525

-----------------------------------
Purchases

20/1/2005 $1000
12/2/2005 $2000
10/3/2005 $1500

Total $4500

-------------------------------------

Summary

CAR 425
BUS 900
4WD 200

TOTAL 1525

---------------------------------------
 
Insert a crosstab in the report footer where you use vehicle type as the row, and mileage as the summary.

-LB
 
Thanks will have a look at crosstabs. Have not used these before - hopefully not too complex.
regards
 
I inserted my crosstab and now have a summary that provides my totals as required. After completing this step I realised that I might be able to use the total in the crosstab summary further.

Is it possible for me to use this crosstab total to do a mathematical calculation with. For example simply divide the total by 2 for each of the crosstab group totals.

I tried adding another column and putting a formula in that but ended up with data right across the page.
 
There is a way to do calculations within the crosstab, but you might find that you can simply create a formula:

{table.amt}/2

And use that as a second summary field in your crosstab.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top