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

Sum from report header to page header? 1

Status
Not open for further replies.

Bloke152

Programmer
Aug 9, 2005
123
NO
Oracle 9i
Crystal 9

I have been asked to show a summary that is currently in the report header on every page. I tried to just dragging it down but it didnt work. I then tried to make a running total summarising the same field and placing that in the page header, but thats only summarising the values on the page rather than the whole report.

Cut a long story short i want a summary of all the data in one field in the page header.

Any ideas?
 
All the data for the entire report on every page header?

If so write a simple formula:

Sum({yourField})

You cannot use an inserted summary to dothis, you must write a formula.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
ah.... next problem i forgot to mention,

The field being summarised if a formula field that basically consists of...

if isnull({table.field1}) or {table.field1} <0
then {table.field2} * {table.field3}
else {command.field1} * {table.field3}

This causes a problem because i cant sum by this as it will ask for a field. sorry i missed this out, genuinly forgot about it.
 
What is {command.field1}? Is this not a database field? If not what is it?

Also where are you placing this formula on your report, the details section?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
You should be able to create a second formula that references the first:

sum({@firstformula})

-LB
 
sorry about the command thing, i was thinking about somethine else and typed it.

I tried creating another formula and refering to the first but it still wont let me place it into the page header.

I have come up with half a solution.
I have converted the report to a command (hense teh command this earlier) and created a field that will always have the letter 'A' as the value.
I have now grouped by this and am going to use this group as my page headers.
This is only half a solution as i dont know how to make this group header print on every page. A college has told me it is possible and has now taken the day off!! a bit convienient i think! I
will open up a new thread for how to do this tho as someone else might find it helpful and they prob wont find it in here!
 
If your first formula was in fact:

if isnull({table.field1}) or {table.field1} <0
then {table.field2} * {table.field3}
else {command.field1} * {table.field3}

Then you should definitely be able to use:

sum({@yourfirstformula})

...in the page header.

To answer your second question, go to the group expert->select the group->options->check "repeat group header on each page".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top