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

Parameter passing to Subreport.

Status
Not open for further replies.

sreeramnavale

Programmer
Feb 18, 2004
40
US
Forum,

I use Crystal Report 9.0.

I am building report with Database Expert retriving data with SQL Command.
select
pack_no,
packitem_breakout.item,
item_master.item_desc,
item_master.dept,
(select dept_name from deps where deps.dept = item_master.dept) department_name,
item_qty,
item_loc_soh.stock_on_hand,
item_loc_soh.av_cost
from
packitem_breakout,
item_master,
item_loc_soh
where
pack_no in (select pack_no from packitem_breakout where item = '{?SKU}')
and item_master.item = packitem_breakout.item
and item_loc_soh.item = packitem_breakout.item
and loc = {?WH}
Note: {?SKU} and {?WH} are parameters which are got in SQL Command.


This report has a subreport which has Database retriving data with SQL Command
select
packitem_breakout.item,
packitem_breakout.item_qty,
item_loc_soh.stock_on_hand
from
packitem_breakout,
item_loc_soh
where
packitem_breakout.pack_no in (select pack_no from packitem_breakout where item = '200017226')
and item_loc_soh.item = packitem_breakout.item
and item_loc_soh.loc = 554

In this subreport SQL Command I am using
1. item = '200017226'
2. item_loc_soh.loc = 554

How can I change this to
1. item = '{?SKU}'
2. item_loc_soh.loc = {?WH}
where {?SKU} and {?WH} comes from main report.

I will greatly appreciate your help.

SPN
 
Create the same parameters within the subreport command and replace the hard values with the parameters in the command. Then in the main report, go to edit->subreport links->move the main report parameter to the right, and in the bottom left corner, use the dropdown to select {?SKU}, not the default {?pm-?SKU}. Repeat for the second parameter. This will link the two sets of parameters with each other.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top