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

Linking Subreport Based on Formula Fields 1

Status
Not open for further replies.

TheLibrary

Programmer
Joined
Nov 19, 2003
Messages
37
Location
US
Page 371 of The Complete Reference Crystal Reports 9 states "Once you've created the formula in the report that contains the separate Name fields, the Name formula field will appear in the Subreport Links dialog box and you can choose it as a From or To linking field".

I have defined my Name field formula in the Main report. When I attempt to select it in the Subreport Links, it is ONLY available in the From section.

I created the same formula in the Subreport and then it becomes available in the To section, but doesn't work.

What am I missing?
 
Can you clarify what you mean by "doesn't work"?

Did you create a record selection formula in the subreport that constrains the records according to the formula value from the main report?

hth,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
"Doesn't work" = no data retrieved
and
I did not create any subreport record constraints for the formula value.

More specifically:

In the Main report I have a string field called NAME.
The text is usually 7 characters long, but sometimes 10.
I have defined the formula LeftNAME as Left{NAME,7} in the Main report.

The Subreport database only has data for 7 character entries.

There is data for the first 7 characters of the NAME entries with 10, in the subreport database.

I have linked the Main "Fields to link to:" as LeftNAME and the "Subreport parameter field to use:" is ?Pm-LeftNAME.

Unless I also define the LeftNAME in the Subreport, it is not available in "Select data in subreport based on field:".

If I do or not, no data is retrieved when the original NAME is 10 characters.
Works fine when NAME is 7 characters.

Thanks
 
Go into the record selection formula in the subreport.

What does it say?

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
With the LeftNAME formula in both the Main and Subreport

{@LeftNAME}={?Pm-@LeftNAME} and

has been added to the record selection formula in the subreport.
 
Solution Found!

"Did you create a record selection formula in the subreport that constrains the records according to the formula value from the main report?"

Answer: yes

Removal of the extra constraint secured the link!
Thanks IdoMillet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top