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!

Pass paramater from sub report to main report

Status
Not open for further replies.

sara07

Programmer
Feb 4, 2008
23
US
Hi,

Is it possible to pass parameters from sub report to main report. Okay this is the situation: I have some field Iata num, Agency - as description and Travel year. I have Iata number as static so users can just select the data from drop down. But since it was not pulling right data from main report because of joins in view. I thought to create sub report - a different view which only selects certain fields - so i can just pass it. but when i right clicked on sub report - change parameter links - I was trying to connect them together. But this is not working. Note: the Iata field in sub report has data and I want the parameter prompt to select the data on field and so that it filters with main report. Please help?
 
This is unclear. Are you trying to limit the parameter list of values for Iata? Please try to explain again. You must also identify your CR version--every time you start a thread.

-LB
 
You can used Shared Variables to pass a value back from a subreport to the main report - use SEARCH to find examples, if that's what you want.

If you want a parameter in both the subreport and main report, define it in the main report and then used Subreport Links to pass it down.

AS Lbass says, it helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I am using Crystal report xi.

Hi I need help with shared variable. I did look for an example for shared variable.

I have on my sub report this formula:
WhilePrintingRecords;
Shared StringVar IataSub := {?Iata}

And I have parameters on sub report as Iata and Agent Name as static with select expert: It is pulling Iata from the values returning from the sub report.

On my main report I have this formula:

WhilePrintingRecords;
//{?Iata} = Shared StringVar IataSub

{?Iata} = Shared StringVar IataSub;

{v_Rpt_Agency_Sales_Summary.iata_num} = {?Iata};

It is popping up parameter screen for Iata parameter from Main and sub reports. I want to get the values for Iata from sub report and link the parameter to the main report. It is not working. What am I missing?
 
You don't need a shared variable for this. Create the parameter in both reports, add it to the selection formula in both reports, and then go to to edit->subreport links and link the parameters to each other. Be sure to use the dropdown in the lower left to select {?Iata}, not the default {?pm-?Iata}.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top