Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL in Crystal Reports

Author  Topic 

little_piggy
Starting Member

2 Posts

Posted - 2007-03-20 : 11:38:07
I'm new to SQL but have quite happily been using Crystal Reports without it until now.

I am creating a letter template and it has the name at the top then the address

<name>

<address1>
<address2>
<address3>
<address4>

There is always an address 1, but maybe not a 3 or a 4, and aparently we dont want any line gaps to show, so I figured i should use an isnull to eliminate the line and to move the other address line up?

Not sure what to put though, any ideas?

Thanks in advance for any help :o)

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-03-20 : 12:32:40
usually, in Crystal, I have found it is easier to create a formula, called it "AdressLines" for example, and in that formula do something like this (warning: i haven't written a crystal formula in a while, syntax and/or keywords might be off):

stringvar ret;

ret := address1;
if not isnull(address2) then ret := ret + chr(13) + chr(10) + address2;
if not isnull(address3) then ret := ret + chr(13) + chr(10) + address3;
if not isnull(address4) then ret := ret + chr(13) + chr(10) + address4;

ret;


Something like that .. make sure that when you put the formula on the report, the field is set to "Can Shrink" or "Can Grow" or whatever those options are called.

(sorry, I'm very rusty in crystal ... )

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

little_piggy
Starting Member

2 Posts

Posted - 2007-03-20 : 12:36:33
lovely thanks, i'll give it a go
Go to Top of Page
   

- Advertisement -