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

Pass the Parameters to Subreport?

Status
Not open for further replies.

vikoch

Programmer
Feb 6, 2008
38
US
I need to pass the parameter fields from main rpt. ro subreport.
Is there anyway to do this.
Please help.
 
Go to edit->subreport links and add the main report parameters to the right box. Select the subreport field to link to OR in the subreport create the same parameters, and then in the subreport linking screen, use the dropdown list in the lower left hand corner to select {?parm} as the subreport field instead of the default {?pm-?parm}.

-LB
 
Thank you very much.
Another report.
I need to pass one of the selected value(column value) from the main rpt to subreport. Is there anyway to do this.
 
You are not being specific enough. Please explain in more depth.

-LB
 

step1 - Main report
select col1, col2, col3, col4
from tbl
group by col3

step2 - insert subreport into Main report.
pass col2, col4 to subreport.

Let me know if it is clear.



 
More details.

Main report:
Creates exam questions sheet.
Select question, answers, question_#
from tbl1
based on domain(parameter field)

Subreport:
Creates exam answer sheet
Select question_#, correct_answer
from tbl1

I would like to pass correct_answer, question_#
from main report to subreport.

Thanks. IK
 
If you are using tbl1 in both main and sub reports, wouldn't correct_answer be available on the subreport? Not even sure why you would even need a subreport.
 
So where is the subreport located? What report section?

-LB
 
I placed the subreport in 'RF'

I need to create separate subreport with the correct_answers only... because, I create main rpt with questions for the exam; I select questions randomly. And, I need to create a subreport with the correct_answers (tbl_column)for the same questions I select for the main report.
example - Main report with questions for the students and subreport for the instructors.

Tahnk you IK>
 
What version of Crystal are you using and what type of database are you accessing.

How is your paramter set up? Does it have multiple values? If so, just follow LBASS first suggestion and pass the Question parameter (e.g., ?-QParm) to the subreport and pull the answers from tbl1

You subreport record selection would look like

tbl1.question_# in {?-QParm}
 
I am using Crystal 9 and IMS database.
I used LBASS suggestion and I was able to create the main and sub reports, but I did not get same tbl1.question_# in main and sub rpts. They were different.
Thanks
 
Create the same parameter in both main and subreports. Then in the in subreport linking screen, move {?question} to the right (from the main report), and in the bottom left corner, use the dropdown to select {?question}, NOT the default {?pm-?question}.

In both the main and in the subreport, go to report->selection formula and make sure it says:

{table.question} = {?question}

Do not link on any other fields. Make sure you are sorting both main and subreports the same way so that the answers will correspond to the questions.

-LB
 
Thank you very much,

But, I also need to (example)
select randomly 5 {table.question} for {table.domain}= 1
4 {table.question} for {table.domain}= 2
3 {table.question} for {table.domain}= 3
6 {table.question} for {table.domain}= 4

How would I do this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top