Print Page | Close Window

Display Parameter Value

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17693
Printed Date: 02 May 2024 at 7:32am


Topic: Display Parameter Value
Posted By: Yarra
Subject: Display Parameter Value
Date Posted: 04 Oct 2012 at 12:36pm

I am using a multivalue cascading prompt (Location_ID) which accepts the Location ID in LOCATIONS table as values.

And on the report header I want to display the Location_Names but not Location_Ids.

For Example : (?Location_ID) Parameter has vaues 2 and 3.

In the Locations table - Location_ID 2 its USA and for location_id 3 its Canada.

Now on my report heander I want to disply USA, Canada (not 2 and 3)

What is the best way to achieve this?




Replies:
Posted By: Sastry
Date Posted: 04 Oct 2012 at 7:57pm

Hi

 

We can get the Location Name but the issue is displaying on your report header.   If you would like to print in your report footer then you can go for the below formula :

 

Stringvar x;

If {?Location_ID} = {Databasefield} then

X:=x+{Location Name};

 

Place the above formula in your detail or the section where you are displaying location name and also place the same formula in report footer.

 

If you want to display Location Name on report header then you need to insert the same report as sun report .

 

--Create a new report header on top of actual report header

--Insert the same report as sub report in newly created report header

--In the sub report create following formula :

Whileprintingrecords;

Shared Stringvar Lname;

If {?Location_ID} = {Databasefield} then

Lname:=Lname+{Location Name};  //

 

Place the above formula in your detail or the section where you are displaying location name in your sub report.

 

Now in the main report create one more formula like :

 

Whileprintingrecords;

Shared Stringvar Lname;

 

Place the above in your main report header .

 

Note : you need to link your sub report parameters with main report parameters else it will display all parameters while refreshing your report.

 

 



-------------
Thanks,
Sastry



Print Page | Close Window