Print Page | Close Window

Parameters Problem - Urgent

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=8341
Printed Date: 08 May 2024 at 2:06am


Topic: Parameters Problem - Urgent
Posted By: zahidkhan
Subject: Parameters Problem - Urgent
Date Posted: 15 Nov 2009 at 4:37am
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,
Zahid



Replies:
Posted By: maniacneron
Date Posted: 16 Nov 2009 at 2:37am
hi zadikhan
define a formula field with the value  paramater you take from main report.
After that right click on the subreports and click change subreport links.Add the formula field you deifned and click ok. It will create a parameter field in your sub report with same value you can use it.
here is a sample report by the way i am using crystal reports 2008 next time you better write which version of the crystal reports you are using.

i hope this helps.

http://rapidshare.com/files/307761747/test.rpt.html


Posted By: lockwelle
Date Posted: 16 Nov 2009 at 6:57am
In this case, why use commands?  Why not join to the tables and set the joins to be on the department number....or set the links to the subreports to be the department passed in from the main report. In a way, it's all the same, I just don't see the need of the command.
 
I ask only because it is my belief that the command object was not designed to be used this way.  Not that you can't, as many do, but there also seem to be many problems as well. It seems that commands were designed to support dynamic parameters, but I could be wrong.
 
HTH



Print Page | Close Window