Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Missing characters in string! Post Reply Post New Topic
Author Message
trentz
Newbie
Newbie
Avatar

Joined: 19 Jun 2012
Location: Australia
Online Status: Offline
Posts: 16
Quote trentz Replybullet Topic: Missing characters in string!
    Posted: 25 Jun 2012 at 8:48pm
I have created a formula field that repeats, and it is displaying with the right-most characters removed, leaving a varying (apparently random) number of characters in the field. The resulting field is always much shorter than the container in which it sits, and besides, the field is allowed to grow..
What the hell is going on? Where are my missing characters?? Can anyone please help with this quite ridiculous nightmare?
A world of unexamined lives is a waste of a world!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 26 Jun 2012 at 3:30am
What is the formula?
 
-Dell
IP IP Logged
trentz
Newbie
Newbie
Avatar

Joined: 19 Jun 2012
Location: Australia
Online Status: Offline
Posts: 16
Quote trentz Replybullet Posted: 26 Jun 2012 at 1:07pm
Hi Dell, thanks for listening. Here's the formula:
 
stringvar details;
stringvar name;
stringvar position;
stringvar company;
// fill the name value
name := {vnl_Event_Speakers.ATTENDEE_TITLE};
// fill the position value
if (Trim({vnl_Event_Speakers.ATTENDEE_COMPANY}) = "")
then(
    position := ""
)
else(
    position := ", " & Trim({vnl_Event_Speakers.ATTENDEE_COMPANY})
);
// fill the company value
if (Trim({vnl_Event_Speakers.ATTENDEE_CO_ID}) = "")
then(
    company := ""
)
else(
    company := ", " & Trim({vnl_Event_Speakers.ATTENDEE_CO_ID})
);
// concatenate them and return
details := name + position + company;
details;
 
I hope this offers some insight...
A world of unexamined lives is a waste of a world!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 28 Jun 2012 at 4:08am

First, I would take out the final semi-colon.  Sometimes that causes some weird issues.  Also, if I were doing this I would take away the "details" variable and just make this the last line of the formula:

 
name + position + company
 
 
Second, is it possible for any of the fields to be null rather than a blank string?  If so, you need to handle that - if you don't, the formula will return blank for any record that has null values.
 
-Dell
 
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.016 seconds.