Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Sort By Parameter Post Reply Post New Topic
Author Message
luka
Newbie
Newbie


Joined: 10 Mar 2011
Online Status: Offline
Posts: 6
Quote luka Replybullet Topic: Sort By Parameter
     Posted: 24 Mar 2011 at 9:53am
Hi all,
 
I need help of yours.
 
I created sortby parameter that will ask users to pick either Account or Customer sorting.
 
How to display this sortby parameter values in Report Header with a label?
 
Thanks.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Mar 2011 at 10:24am
what exactly is the param? A string with thiose two values? a number with 1 or 2? something else?
IP IP Logged
luka
Newbie
Newbie


Joined: 10 Mar 2011
Online Status: Offline
Posts: 6
Quote luka Replybullet Posted: 24 Mar 2011 at 10:51am
It is a string with those two values.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Mar 2011 at 10:56am
label is just a text box with your text
display the value just drag and drop the parameter field in the report header


Edited by DBlank - 24 Mar 2011 at 11:06am
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 24 Mar 2011 at 11:05am
If you want to set up your sort based on the selected parameter, you'll create a formula that looks something like this:
 
If {?MyParam} = "Account" then {table.AccountNumber}
else {table.CustomerName}
 
If your account number is in a numeric field instead of a string field, you'll have to convert it to a string using the ToText() function in order for this to work.
 
-Dell
IP IP Logged
luka
Newbie
Newbie


Joined: 10 Mar 2011
Online Status: Offline
Posts: 6
Quote luka Replybullet Posted: 24 Mar 2011 at 11:07am
Thanks.
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