Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: append characters to parameters Post Reply Post New Topic
Author Message
pl80
Newbie
Newbie


Joined: 27 Nov 2012
Online Status: Offline
Posts: 5
Quote pl80 Replybullet Topic: append characters to parameters
    Posted: 27 Nov 2012 at 12:29am
My report obtains data using a stored procedure call.  Parameters are passed from the web interface.  However, I need to append some of the parameters with some extra characters.  How can I do that?
 
Please note: I am only allowed to do that at the report level.
 
Crystal Reports 2008
 
Thanks in advance.


Edited by pl80 - 27 Nov 2012 at 12:30am
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 27 Nov 2012 at 1:21am
Hi
 
Your question is not very clear.. You want to add few characters to your parameter value and display in your report ?
 
if so, create a formula like :
 
"yourcharacters"&{?Parameter}
OR
You want to add few characters and validate your modified parameter against database fild value in your stored procedure ?  If so, then you need to either modify the stored procedure by adding additional characters.  Because, once you enter your parameter then it will hit the stored procedure and we can't make any modification in between.
 
 
Thanks,
Sastry
IP IP Logged
pl80
Newbie
Newbie


Joined: 27 Nov 2012
Online Status: Offline
Posts: 5
Quote pl80 Replybullet Posted: 27 Nov 2012 at 1:47am
Actually, the latter.
 
I was hoping it was possible somehow, since the call to the stored procedure can be edited (Edit Command in Database Expert).
 
I am not allowed to make changes to the DB objects (incl. stored procedures). 
 
Thanks anyway.
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 27 Nov 2012 at 2:17am
Hi
 
Absolutely you are correct if you call stored procedure through add command.
 
To do this :
 
--Create a report level parameter --right click on parameters and new.
 
Now go in create new connections--Add command -- now call your stored procedure from here.
 
Proc <stored procedure name>, {?reportleveparameter}+{?accutalparameter}
Thanks,
Sastry
IP IP Logged
pl80
Newbie
Newbie


Joined: 27 Nov 2012
Online Status: Offline
Posts: 5
Quote pl80 Replybullet Posted: 27 Nov 2012 at 2:33am
Sastry,
 
Unfortunately this won't work: "Incorrect syntax near '+'".
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 27 Nov 2012 at 2:35am
Hi
 
Can you check with '&'
Thanks,
Sastry
IP IP Logged
pl80
Newbie
Newbie


Joined: 27 Nov 2012
Online Status: Offline
Posts: 5
Quote pl80 Replybullet Posted: 27 Nov 2012 at 2:39am
Same thing.
 
IP IP Logged
pl80
Newbie
Newbie


Joined: 27 Nov 2012
Online Status: Offline
Posts: 5
Quote pl80 Replybullet Posted: 27 Nov 2012 at 11:29pm
Looks like I've solved it.
Inside the database Command, we must declare a variable, edit it (add characters), and then use the variable in the SP call.
 
For ex.
declare @word varchar(20)
select @word = 'aaa' & '{?MY_PARAM}'
exec sp_MyProc @param1 = @word
 
A parameter of a stored procedure cannot be edited directly.


Edited by pl80 - 28 Nov 2012 at 3:07am
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 28 Nov 2012 at 1:29am
Hi
 
Very glad to know that it was resolved and thanks for sharing
 
 
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.008 seconds.