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

Sub report linking

Status
Not open for further replies.

gazza11

Technical User
Jan 12, 2003
46
0
0
AU
I am using CR8.5 to create a report. I am grouping by a list a names with an ID number and using this ID number as a parameter that is entered by users. The names and ID come from a table called 'Employee'. The report works fine to this point - not much to brag about I know.
Under each group I am trying to list other information about each employee - this information comes from a table called 'Qualifications' but I am trying to list information about specific qualifications so I used a subreport and linked the sub report to the parameter. I then used the select expert to alter the formula as follows:
{qualifications.empID} = {?Pm-?EmpID} AND {qualifications.description} = "Electrician".

This works OK if I only provide one EmpID parameter. When I enter two parameters, the qualifications for both EmpIDs are shown listed under each employee. Can someone please advise me what I am doing wrong.
 
I do not believe you need a subreport to do this, you should be able to just link the 2 tables by employee ID and drag the fields onto your report.

Having said that, I would like to know what you mean by "2 parameters"....are you talking about 2 parameter fields or two values for one parameter? Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
Why link based on the parameter value(s)? Try linking on the EmpID out of your main report instead.
 
dgillz - When I created my initial report I did not use a subreport as you suggested and I do have a link via EmpID to each table. If I only pass the single parameter from VB I seem to get the correct presentation but the VB program can pass up to 5 values of the same parameter and that is when my report goes wheels up. It seems to list the same records for each group.
Will try the link on main report EmpId and see how that goes.
Appreciate any help.
 
Have tried using the EMPID from the main table (ie that table with Names) without a subreport and it seems to work reliably except I now get blank lines if the criteria is not met. I am trying to get format as below:

Name Elect LicNo Expires First Aid No Expires
Joe
XY123 12/12/2002 FA-1234 10/06/2001

etc
I am grouping by name and using a formula in text box ie.
If {Qual.description} = "Electrician" and {Qual.EmpID} = {Employee.EmpID} then {Qual.QualNumber} and then similar for the date.

The blank lines must be coming from records that do not meet this criteria. How do I stop blank lines and I was hoping to get the presentation all on one line as shown above but it looks like I will have to be happy with a separate line for each record.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top