Print Page | Close Window

Supress Field in Text Box

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
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=7472
Printed Date: 01 May 2024 at 11:47pm


Topic: Supress Field in Text Box
Posted By: Grifter
Subject: Supress Field in Text Box
Date Posted: 25 Aug 2009 at 3:18am
Hi

I think this is a similar problem to waely's post but I cannot see a solution to my problem there. I have a text field with title, firstname, lastname within a text box. The text box is headed as Name.

Sometimes the person does not have a title inserted so the data can look like this:

Mr John Smith
  Andrew Smith
Mrs Sheila Bongo
  Amanda Brown

So when the title is missing how do I suppress this, that is what do I do in CR to say hide the {Title value} empty space and left align name?

There is a bit on CR help but it does not tell you how to actually do this it just discusses VB code way of doing it but i'm using SQL Server data.

Thanks

G



Replies:
Posted By: DBlank
Date Posted: 25 Aug 2009 at 7:28am

If I understand you correctly your issue is that the space you typed between the title and fname is the issue.

Instead of using a text box use a formula field to add the items together conditionally.
{table.Title} +
(if isnull({table.Title}) or {table.Title}="" then "" else " ") +
{table.Fname} + " "
{table.Lname}
 


Posted By: Grifter
Date Posted: 25 Aug 2009 at 8:28am
Ok will give that a go.

G



Print Page | Close Window