Joined: 24 Jun 2014
Location: United Kingdom
Online Status: Offline
Posts: 2
Topic: Concatenated fields not showing Posted: 24 Jun 2014 at 6:03am
Hi,
I am writing a labels report to print address labels from an Access database. I have concatenated Town and Zip fields in to a new formula field "TownZip" and also the title and full_name field into "FormalName"
I am finding that where one of the concatenated fields is empty, the new formula field is suppressed. Changing "supress if blank" option has no effect. If, for example I add "Mr" to title field on a database record, then all is well. But whenever any of the concatenated fields are empty, then nothing is printed for that line. I am using Version 11, yet I had successfully done this before with v8.5.
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 24 Jun 2014 at 9:15am
I'm not sure that the feature that kostya mentions is available in Crystal 8.5. If it's not, you'll have to do something like the following:
StringVar title := "";
StringVar full_name := "";
if not IsNull({MyTable.Title}) then title := {MyTable.Title} + " ";
if not IsNull({MyTable.Full_Name}) then full_name := {MyTable.Full_Name};
title + full_name
You would do the same type of thing for your Town/Zip combination.
For more information about working with null values in Crystal, see my blog post here: http://sapbiblog.com/2013/03/25/what-is-null-and-why-is-it-important-for-crystal-reports/.
Joined: 24 Jun 2014
Location: United Kingdom
Online Status: Offline
Posts: 2
Posted: 24 Jun 2014 at 11:34pm
Thank you Hilfy and Kostya.
Changing each of the formula fields (one shown below) to:
StringVar title_name := "";
StringVar full_name := "";
if not IsNull({Recipient.title_name}) then title_name:= {Recipient.title_name} + " ";
if not IsNull({Recipient.Full_Name}) then full_name := {Recipient.Full_Name};
Trim ({Recipient.title_name} & ' ' & {Recipient.full_name})
as well as changing the null handling report option has sorted me out.
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