Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Concatenating Fields and Label Post Reply Post New Topic
Author Message
Baillie11
Newbie
Newbie
Avatar

Joined: 25 Jun 2009
Location: Australia
Online Status: Offline
Posts: 2
Quote Baillie11 Replybullet Topic: Concatenating Fields and Label
    Posted: 25 Jun 2009 at 6:31pm
Hi all, im hoping someone can help here.

I am developing a report that will display text, then I want to add a label centered in the report then add more text it.

I initially added a field (Field1) then a label then another field (Field2), BUT if the original Field's text was too long, its text would display over the top of the label (and possibly field2 also).

My first thought is to concatenate the 3 elements but I cant see how to do that with a label (I can certainly do it without any problems when its just the fields).

Can anyone suggest a solution??

I am happy to look at other solutions that do not involve concatenation.


THANK YOU ALL in advance for your suggestions.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Jun 2009 at 8:24pm
you can use a text object and type your labels then insert the databse fields into it
or
create a formula field just using " " around your labels and add your fields in where you want (assuming your db fields are text else you need to convert them to text) here is a sample:
"I am label 1: " + {table.field1} + "  This is label 2: " + {table.field2} + " Label 3: " + {table.field3}


Edited by DBlank - 25 Jun 2009 at 8:25pm
IP IP Logged
Baillie11
Newbie
Newbie
Avatar

Joined: 25 Jun 2009
Location: Australia
Online Status: Offline
Posts: 2
Quote Baillie11 Replybullet Posted: 25 Jun 2009 at 8:47pm
Thanks DBlank my first preference is your first suggestion, but HOW do I insert fields in a text object??

Im sorry if this is a dumb question.

Thank you though for your help.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Jun 2009 at 9:15pm
No worries,
Just drag and drop. YOu will see a pipe appear where it will be dropped into the text.
Sometimes it is easier to expand the text object to a really large field so you can see all of it.  Long table or field names make it a pain to see what is going on or where in the string you are actually dropping a field. Once you have it in the correct sequence shrink it back to the size for displaying.
 
in design mode you end up with a text object that looks like
Name: {table.fname} {table.mname}. {Table.lname} Address: {table.address} ...
 
in preview mode you end up with a text object that looks like
Name: Jane M. smithe Address: 1234 Main street ...


Edited by DBlank - 25 Jun 2009 at 9:20pm
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.