Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How do I trim an parameter? Post Reply Post New Topic
Author Message
KopiteJay
Newbie
Newbie
Avatar

Joined: 15 Sep 2008
Location: United Kingdom
Online Status: Offline
Posts: 11
Quote KopiteJay Replybullet Topic: How do I trim an parameter?
     Posted: 17 Sep 2008 at 5:47am
Hello,

Just started dabbling with Crystal 2008 (never used any other version before) and I have a parameter set up that enables the user to name a report title.

Whatever they enter needs to be displayed before the text "Listing Report". For example, if they entered "Clients" it would display - Clients Listing Report.

At the moment (and this could well be completely wrong), in the design I have the parameter ?lvClientsWording next to a text box containing the text "Listing Report". How do I get rid of any space between the end of the parameter (whatever they enter) and the text box?

I suppose what I am actually asking is how do I make the parameter box change size depending on length of the text entered by the user?

Or am I doing this completely wrong?

Thanks,

Jason
IP IP Logged
JohnT
Groupie
Groupie
Avatar

Joined: 20 Jan 2008
Online Status: Offline
Posts: 92
Quote JohnT Replybullet Posted: 17 Sep 2008 at 2:34pm

An easy way to do this is to create a formula field and concatenate the parameter with whatever you have in the text box.  Move this field to your report in place of the parameter and the text box.  That way, you won't have to worry about the length of the parameter field. You will always have 1 space between the end of the parameter value and the word "Listing" 

 As an example: 
 
If the parameter was "Clients", then the formula:
       parameter & " Listing Report"
would give you "Clients Listing Report". 
 
If the parameter was "Management" then the formula:
      parameter & " Listing Report"
would give you "Management Listing Report". 
 
It doesn't matter how many characters are entered for your parameter.  It will always be spaces properly.  When you move this new field to your report, you will have to make the box large enough to accommodate a parameter someone entered with a large number of characters. 
 
 
 
Hope this helps.
 


Edited by JohnT - 24 Sep 2008 at 8:36am
IP IP Logged
KopiteJay
Newbie
Newbie
Avatar

Joined: 15 Sep 2008
Location: United Kingdom
Online Status: Offline
Posts: 11
Quote KopiteJay Replybullet Posted: 18 Sep 2008 at 1:50am
Excellent, that's working spot on.

Much appreciated, cheers.

Jason.
IP IP Logged
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