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

Search record via primary key and use another field to filter

Status
Not open for further replies.

netpatnet

Technical User
Mar 15, 2004
1
CH
We are using Peregrine Assetcenter (SQL Database) and Crystal Report v7 together. In the database we have a location-table with locations, sub- and sub-sub-locations etc.

---- Sub-Location
|
Location |--- Sub-Location --- Sub-Sub-Location --- ....
|
---- Sub-Location

We are searching for a solution, how to build a CR report which is printing a location with all the the sub-locations (unlimited level) underneath.

The Assetcenter is "only" giving the unique ID ({@amLocationId}) of the highlighted location as parameter to CR. Every location-record contains a field with the unique ID ({amLocation.lLocaId}) and a field ({amLocation.lParentId}) with the parent location. The filter we are currently use is looking as follows:

({amLocation.lLocaId} = {@amLocationId} or
{amLocation.lParentId} = LocId)

With this filter CR is showing the location and the 1st level of sub-locations, but deeper levels (sub-sub-locations etc.) is not showed.

Is it possible to locate a record via the filter {amLocation.lLocaId} = {@amLocationId} and use the value of another field of the found record as the report-filter?

Example:
1.)
Search location-record with filter {amLocation.lLocaId} = {@amLocationId}

2.)
Use value of {amLocation.FullName} of found record to find all sub-location-records

btw: Our report already uses subreports.
btw2: In Assetcenter it is not possible to send the FullName-field as paramter to CR. Only the primary key is possible to send.

Thank you very much for any hint.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top