Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
General
 MetaMatica Forum : General
Subject Topic: Total... before displaying detail records Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
MartyMed
Newbie
Newbie


Joined: 06 December 2008
Online Status: Offline
Posts: 3
Posted: 09 February 2009 at 4:48am | IP Logged Quote MartyMed

I'm trying to get a total showing for the records in a detail band, above the display of the detail records. For instance in your example report you show the total for the Chicago sales department as being $9,400. But this is shown after the detail records for the location group.

Is it possible to display the following;

Location: Chicago Total: $9400

  11 James 950

  12 Blake 2850

etc...

Have tried using variables and dataset SUM() but getting either zero or the sum of the previous group.

Any help appreciated.

Back to Top View MartyMed's Profile Search for other posts by MartyMed
 
administrator
Admin Group
Admin Group
Avatar

Joined: 01 October 2003
Online Status: Offline
Posts: 46
Posted: 09 February 2009 at 7:34am | IP Logged Quote administrator

When you use one dataset you can't put totals before detail, because you must calculate totals before printing.

I describe you for demo database.
In you case you must have two datasets:
1-st dataset calculates totals
select dept.loc, sum(emp.sal) as sum_salary from emp, dept
where emp.deptno = dept.deptno
group by dept.loc


2-nd dataset shows details for each row in master dataset (subdetail band)
select emp.* from emp, dept
where emp.deptno = dept.deptno and dept.loc = :loc


Download the example here and see it yourself.


__________________
Oleg Yershov
Back to Top View administrator's Profile Search for other posts by administrator Visit administrator's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.91
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.0615 seconds.