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

Parameters in Subreport - Urgent 1

Status
Not open for further replies.

zeekay

Programmer
Nov 15, 2009
18
GB
Hi All,

I have a report which has one main report and two subreports. Just to explain my problem in detail that my report is as follows:

Main Repot based on a command (select empno, ename, address from emp where deptno = :p_deptno)

Sub Report1 based on a command (select empno, attendace_days from emp_attendance where deptno = :p_deptno)

Sub Report2 based on a command (select empno, sal, comm from emp_sal where deptno = :p_deptno)

You can see that all the reports above are using same parameter name :p_deptno. I have created parameter in commands.
So, when I run the report, it displays three parameter fields. So, I enter department 10 in all the three boxes to run the report. But I want to enter department parameter value just once. What is the best way to achieve this. ?

Thanks,
Zeekay
 
Right click on each subreport and select "Change Subreport Links". Move over the main report parameter from the list on the left to right. In the lower left find the matching subreport parameter - not the PM parameter. If CR puts a check mark in the "Select data" option on the right, then take that check mark out.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Hi Ken,

Thanks for your reply. I have tried your suggestion for one subreport and it has worked. It did not ask me for parameter for that subreport. But now after your change, it is showing me all employees for the given department on the same page. I want to show one employee on a page. When I navigate to the next page, I should see the next employee on all subreports.

I have attached the screenshot of my previous parameters screen. It was showing employees correctly but the issue was to remove extra parameter prompts.

Thanks for your help.
Zeekay
 
If it worked right before the change, when you entered the same value for all three parameters, then linking the subreports should have fixed that without changing anything else about the way the report works.

I would start over with the report that works correctly (confirm that it works correctly first). Do the steps again making sure you select the existing parameter in the subreport and confirm that the selection formula of the subreport doesn't change.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
I will do it again tomorrow morning because its Sunday evening and the server is going to be down for backups etc.
I will post you what I get.

TA
 
Hi Ken,

The report parameters worked perfectly as I wanted. Thanks very much for your help.

I have another question for Crystal Viewer now. I am going to create a new thread for it.

Regards,
Zeekay
 
Hi,

I have got an additional requirement in the same report. I need to add second parameter to main report and subreports.
Currently, I have given Deptno in "Subreport parameter field to use". Its working perfectly. But can I add the second parameter too i.e. subdeptno?

Thanks,
Zeekay
 
Yes, add it to all three reports and follow the same steps.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Hi Ken,

I am able to select only one "Subreport Parameter Field to use" in "Change Subreports Links" screen. I have already selected ?dept here. I can't see any way to select the second column i.e. ?subdept.
I want to pass on both of the parameters dept and subdept to subreport. Any idea?

Thanks,
Zeekay
 
You can only select one to go with each parameter you move over at the top. But if you highlight the second parameter at the top right you can select a sub parameter to go with it.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top