Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Print a variable Post Reply Post New Topic
Author Message
Joel Krywolt
Newbie
Newbie
Avatar

Joined: 08 Nov 2007
Online Status: Offline
Posts: 12
Quote Joel Krywolt Replybullet Topic: Print a variable
     Posted: 14 Feb 2008 at 9:47am
Thanks in advance!
 
What would the syntax be for printing one of my varaiables - V1
in a report?
 
JK
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 14 Feb 2008 at 11:36am
Is this a variable from a program?  If so, you'll need to create a parameter in the report and pass the variable value into the parameter.  You then drag the parameter to where you want it on the report.
 
-Dell
IP IP Logged
Joel Krywolt
Newbie
Newbie
Avatar

Joined: 08 Nov 2007
Online Status: Offline
Posts: 12
Quote Joel Krywolt Replybullet Posted: 14 Feb 2008 at 11:48am
Thanks for your help.
Maybe the code will help...
 
numberVar V :=0;
stringVar V1 :="";
 
V=InStr ({Test.Tag}," ");
 
V1=Left({Test.Tag},V)+{TEST.SIZE}
 
If possible , I would like to update the field {TEST.PART} with V1 .
If this will not work, displaying V1 will do.
 
 
JK
IP IP Logged
Joel Krywolt
Newbie
Newbie
Avatar

Joined: 08 Nov 2007
Online Status: Offline
Posts: 12
Quote Joel Krywolt Replybullet Posted: 14 Feb 2008 at 12:54pm
I'm sorry for not answering your question.
 
The data is from an .mdb file generated by autocad 2008,
and I am using ODBC to connect.  As well, the previous entry is from the CR-X formula editor tool.
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 14 Feb 2008 at 1:44pm
Ahhh...Now I understand....
 
To display V1, do this:
numberVar V :=0;
stringVar V1 :="";

V=InStr ({Test.Tag}," ");

V1=Left({Test.Tag},V)+{TEST.SIZE};
V1
 
What do you mean by "update the field"?
 
-Dell


Edited by hilfy - 14 Feb 2008 at 1:45pm
IP IP Logged
Joel Krywolt
Newbie
Newbie
Avatar

Joined: 08 Nov 2007
Online Status: Offline
Posts: 12
Quote Joel Krywolt Replybullet Posted: 14 Feb 2008 at 2:01pm
As far as updating, I was hoping to write the reults of this expression to a field in the same table I am querying from. (Do not know if CRX can do this)
 
When I entered the code revision:
 
numberVar V :=0;
stringVar V1 :="";
V=InStr ({Test.Tag}," ");
V1=Left({Test.Tag},V)+{TEST.SIZE};
V1
still no data display when I refresh.
 
BTW here is data example:
Tag= "PIPA SMLS 105N"
SIZE= "2"
V1 = "PIPA 2 SMLS 105N"
 
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 14 Feb 2008 at 2:46pm
There is a way to update a table, but I haven't ever done that, so I'm not familiar with it.  Also your formula is not going to get you all of the data you're looking for.
 
Thinking about this formula, here's a way you can do it without using variables:
 
left({Test.Tag}, InStr({Test.Tag}, " ")) + {Test.Size} + " " + Right({Test.Tag}, (Length({Test.Tag} - InStr({Test.Tag}, ""))
 
You may have to "play" with the length in the "Right" statement - using "+ 1" or  "-1" (I can never remember which without playing with it...) to start the second half of the string in the right place.
 
-Dell
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