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!

Summarize SUB and Main 1

Status
Not open for further replies.

CRilliterate

Technical User
Dec 7, 2005
467
US
Data

CO_NAme Status BillAmount

AAAA AC 100
BBB CN 2000
CCC NA 35

So I need to display as :

CO_Name AC CN+NA Total

I am planning to create SUB_Report with Status='AC'
and Main Report will have Status<>'AC'

What worries me is - will I be able to summarize fields from MAin and SUB? Or there another way? Thanks

________________________________________
I am using Windows XP, Crystal Reports 9.0 with SQL Server
 
Note that waht you need to display shows that you aren't using the number, please try to be thorough.

One Cross-tab should handle this.

Create a formula of:

if status in ["CN","NA"] then
"CN/NA"
else
"AC"

Now in the crosstab set the row to the CO_Name, and the column to the above formula, and place the Billamt as a sum in the summary field.

-k
 
Would you recommend crosstab vs SUB?
Thanks

________________________________________
I am using Windows XP, Crystal Reports 9.0 with SQL Server
 
I am only asking because they changing requests so if more 'statuses' will be added I can add one SUB and fix it.
With crosstab it can become undoable at some point.

And my question was aslo can you add 2 values from Main and SUB and get a Sum?

________________________________________
I am using Windows XP, Crystal Reports 9.0 with SQL Server
 
You can pass values back and forth between main and sub, they're called shared variables, as in:

main report report header formula:
whileprintingrecords;
shared numbervar MyTot:=sum({table.field})

Subeport in the group header of the main report, formula in the report header fo the subreport
whileprintingrecords;
shared numbervar MyTot;
MyTot/sum({table.field})

-k
 
Thanks

________________________________________
I am using Windows XP, Crystal Reports 9.0 with SQL Server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top