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

Common parameter for main report and sub-report 2

Status
Not open for further replies.

mgakhar

Programmer
Dec 14, 2005
31
MX
Hi,
I have a Main Report for which I have a parameter "Item Code". I also have a subreport for which I have 3 parameters "From Date", "To Date" and "Item Code". The parameter Item code needs to be commong for both the main report and sub report so that the user gets prompted just once for both reports.

How can I achieve this?

Also note that Im using Command for both Main and sub reports. CR Version is 10 and Im using OLE DB.

I read on this forum that I can do this using shared variable but I wasnt able to do it. I also read on this forum that I cannot do this as Im using command??? Please help this newbie !!

Thanks,
Manish.
 
Set the subreport link to the item code field in the main report, and remove the item code parameter from the subreport.

-k
 
Doesnt work ... I might be doing something incorrectly.

Lets say my main report Command sql is something like -

Select * from ItemMaster item
Where INSTR({?Product}, item.code)>0
and .........

My sub report Command sql is something like -
Select * from SupplierMaster supp
where INSTR({?Product}, supp.itemcode)>0
and ........

Now when I try to link the 2 reports - I link the ?Product field in the Main report to the subreport which creates a ?Pm-?Product parameter in the subreport. I changed my sql in the subreport so that it looks like
Select * from SupplierMaster supp
where INSTR({?Pm-?Product}, supp.itemcode)>0
and ........

However, this one fails. Infact there are some more parameters for the subreport and I dont get prompted to enter values for those. As a result the subreport is empty.

What am I doing wrong?

Thanks,
MG.

If instead I change
 
You can leave your subreport parameter in and link the {?ItemCode} parameter of the main report to the {?ItemCode} parameter of the subreport. This will allow you to use the parameter in the subreport's record selection formula and eliminates double prompting when the report is run.

I don't know why you are not getting prompted on your other subreport prompts. I have never heard of this problem except when you are not using the prompts anywhere in the subreport.

I'm on vers 9.0 which may be a little different from 10.0

MrBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top