Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Display Parameter Value Post Reply Post New Topic
Author Message
Yarra
Newbie
Newbie
Avatar

Joined: 13 Dec 2011
Location: United States
Online Status: Offline
Posts: 10
Quote Yarra Replybullet Topic: Display Parameter Value
    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?

IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet 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
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.031 seconds.