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

Inserting totals from sub reports to main report 1

Status
Not open for further replies.

kagee

Programmer
Apr 21, 2004
30
NL
Hi there,

I need to make some financial statements (profit & loss + balance sheet); but am kinder stuck

Crystal version: 8.5
Database and connectivity: SQL Server

Sample data:
Am using a Sequel view to select the following data
Date, Account No, Account Desc, Amounts.

The SQL view is able to return both income amounts and expenses amounts. The main difference between the incomes and the expenses is the account No. (incomes are '61110*' while expenses are '61190*')

I have made the incomes into 3 subreports and the expenses into 2 subreports. Currently the subreports are all in my report footers (a,b,c,d,e) of the main report.

Expected output:

I need to achieve the following:

Derive the various TOTALS from each subreport and post in to the main report. The main report can be printed with or without the subreports included

PS: Whenever i drag any object to the main report; it scrolls to over 40 preview pages!

Please assist!
 
You should be able to suppress all but the report footer in each subreport in order to display only the total in the main report. If you need to work with these totals in the main report, then in each subreport, create a formula, like the following, changing the variable name each time:

whileprintingrecords;
numbervar sub1tot := sum({table.amt});

Place this on the subreport canvas instead of the total.

Then in the main report, in a section below the one in which the subreport is executing (or you might want to do all of your calculations in a report footer_f section), you can create formulas to make other calculations, e.g.,

whileprintingrecords;
numbervar sub1tot;
numbervar sub2tot;

sub2tot - sub1tot

-LB
 
sounds like you need to hide all the detail from the subreports to just display the total line. Just a thought.

L
 
thanks Lbass for your comments,

the formula however doesnt work - it says a number is required.. maybe its the use of the variable numbervar..

I still got my summary (main report) in the details section, now its suppressed and my sub reports (each shows on a separate page) on the report footers...

I need the main report to show before the subreports and am more or less stuck!

any ideas? Please assist!
 
The variable type has to match your datatype, so if your subreport summary is a currency, then you should replace numbervar with currencyvar, and if it is a string, you should replace it with stringvar. If you need further help, you should supply information about your summaries and their datatypes and what you need to do with them in the main report.

This is your first reference to using the main report for anything but a container report for the subreports, and I'm not sure I follow what your issue is. If you are using the details section for the main report, it automatically would appear before the report footer sections where your subreports are located.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top