Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Parameters Problem - Urgent Post Reply Post New Topic
Author Message

Joined: 15 Nov 2009
Online Status: Offline
Posts: 2
Quote zahidkhan Replybullet Topic: Parameters Problem - Urgent
    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. ?


Edited by zahidkhan - 15 Nov 2009 at 4:39am
IP IP Logged

Joined: 16 Oct 2009
Online Status: Offline
Posts: 11
Quote maniacneron Replybullet 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.
IP IP Logged

Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet 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.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

This page was generated in 0.047 seconds.