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

Sub report to return data in correct group within main report

Status
Not open for further replies.

mdj3366

Technical User
Aug 27, 2002
49
US
Hello -

Using Crystal XI, SQL Server database. I have an invoice report that I run monthly for a client. It is run on the first day of the month reporting the previous month's payment activity (only benefit weeks that have been paid). It is grouped by ADP code. My issue is I need to be able to report the number of participants imported in the prior month, who may not have been paid. I know I can use a subreport but how can I get the subreport to return the participants imported for each ADP Code and return to the main report in the correct group?

Thanks for any help.
 
Create the sub-report and insert it into the ADP Group Header.
Link the Sub-Report to the Main Report on ADP Code.
Create a formula in the sub-report that captures the value or values you want from the Subreport as a Shared Variable.
Code:
//This subreport formula captures a field into a variable called x
Shared StringVar x;
x := x & '|' & {Table.ParticipantName} & '|'
In the main report create a formula that refers back to the Shared Variable
Code:
//This main report formula checks if a field in the main report is in the shared variable
Shared StringVar x;
if '|' & {Table.ParticipantName} & '|' in x then 1 else 0

Gordon
Crystalize
 
The main report is not returning any data. I forgot to mention the main report is pulling the data via a stored procedure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top