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

Passing a Variable to a subreport

Status
Not open for further replies.

socalvelo

Technical User
Jan 29, 2006
128
US
CR11 Oracle DB
Fields: string{location}, numeric {coordinateX}, {coordinateY}

Trying to accomplish: {location.field} contains addresses. The location field has corresponding fields in that same record that are latitude and longitude coordinates, X and Y. In my main report, I choose a date range parameter and one or more locations. Based on the location(s) chosen, I want to locate records that are in a 100ft diameter of the chosen location. I have formulas to do this. @X1 would be {Xcoordinate}-100, @X2 would be {xcoordinate}+100 and so on for Y. The formulas will be in a subreport.

Idea: Use existing parameters for date range and location. I want to pass the {location} parameter to a subreport, then use my diameter formulas to create ranges to look for X and Y coordinates that fall into this range. The end result will be different locations. I created a shared variable formula to pass the {location} field to the subreport.

Question: Am I on the right path? I want to pass the location variable chosen in the main report, but I don't want this formula in the record selection of the sub report. If this is possible, I am no quite sure how to put this formula in the subreport linking box.
 
Instead of linking on location, link on {table.xcoordinate} and {table.ycoordinate}. (I'm not sure how the dates fit in.) Then in the subreport, go into report->selection formula->record and change the formula to something like:

{table.xcoordinate} in {?pm-table.xcoordinate}-100 to {?pm-xcoordinate}+100 and
{table.ycoordinate} in {?pm-table.ycoordinate}-100 to {?pm-ycoordinate}+100

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top