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

Hi I had made one report with on

Status
Not open for further replies.

Fursten

Programmer
Dec 27, 2000
403
PT
Hi

I had made one report with one subreport in it.

In that SUBreport I had made a group (by a field from one table which is being used)so I could make a sum field(of a numeric field). This way I get something like this:

NumberAction1 field_to_sum
Total(a sum field of a numeric field)
NumberAction2 field_to_sum
Total(a sum field of a numeric field)

..... etc

In my main report I had again the NumberAction field like a group and inside it I had a lot of other database fields.
What I would like to have inside each NumberAction group it was that Total field I told you before (calculated in the subreport)... got it?

Something like:

NumberAction1

Filedd 1 Field 2 Field3 Total(that sum)

NumberAction2

Field1 Field2 Field 3 Total(that sum)

... etc...

I can´t make it all in one report because the tables were not made to do that. For instances, if I try to join the fields of those tables I would get a lot of repeated recordsets... because there is nothing in each tables that can be "distincted" :)

Note that the "Sum field" is obtained from another tables diferent from that where I´m getting field1, field2 and field3

Thnak you for your help :)

Sergio Oliveira



 
Are you trying to bring the total from the subreport back to the main report?

Are you familiar with using Crystal Reports variables?

What version of CR do you have? Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Hi,

Yes, I´m trying to bring a total from my subreport to each of the NumberAction fields ... So I need to say that Total X (from my subreport) will be placed as if it was a field from the table were NumberAction1 stands. the same to Total Y (to NumberAction2)... etc...

I´m using CR 7.0 and I´m not familiar with CR variables.

By the way, How can I make distinct as we can do in SQL?(because, the Select clause, is made by CR itself)

Thank you :)
 
You are going to need to use shared variables, which is the only way to bring a value from a subreport to the main report.

You are then going to need to use global variables in the main report if you want to to add up the values captured, because you will need a running total that uses variables to accumulate the values from the subreport.

There is a FAQ on running totals, which has a '3 formula' technique. This will give you an illustration of syntax using Crystal variables.

About Distinct.
Crystal 8 has an option to make a select be 'distinct' but this was not available in V7. In CR you can view the SQL statement but you can't change the initial select. There is a fairly complex way of forcing the SQL to union to a second select statement that uses the distinct clause. Seagate's Knowledge Base article C20007732 explains in detail.

Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top