Print Page | Close Window

Missing characters in string!

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=16853
Printed Date: 16 Apr 2025 at 7:18pm


Topic: Missing characters in string!
Posted By: trentz
Subject: Missing characters in string!
Date 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!



Replies:
Posted By: hilfy
Date Posted: 26 Jun 2012 at 3:30am
What is the formula?
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: trentz
Date 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!


Posted By: hilfy
Date 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
 


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window