# When I add a second carriage return Char(13) to my formula, i get more than one extra space.

I have the following formula:

(
if isnull({Interest_1}) then "" else
""+{Interest_1}
)
+
(
if isnull({Interest_2}) then "" else
chr(13) + ""+{Interest_2}
)

The formula works fine, however I want a little more space between Interest_1 and Interest_2. When I change the second statement to be

(
if isnull({Interest_2}) then "" else
chr(13) + chr(13)+""+{Interest_2}
)

I get what looks to be like 3 spaces between interest_1 and interest_2.  Anyone know what I'm doing wrong?  I can post I screenshot if someone needs to see it.
LVL 4
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Author Commented:
Here are two screen shots..
double-spacing.JPG
single-space.JPG
0
Commented:
What you have in your formula looks OK and I don't think you're actually getting any extra lines.  If you put the two pictures you posted side by side, the second line in the single-spaced picture falls right in the middle of the two lines in the double-spaced picture.  You could try putting two formulas side by side on your report, one with one ChrW (13) and one with two, and see how they line up.

It's not important, but, FWIW, I am wondering why you have "" in the strings after the "else"s (eg. ""+{Interest_1}).  You need "" after the "then"s, but they don't seem to serve any purpose in the strings after the "else"s.

James
0
Author Commented:
Hi James,

Thanks for the comments, I guess the bottom line is I need to control the spaces to be somewhere between the first image and the second image.  Any ideas how to do that? Or is further refinement through a formula impossible? Ie instead of doing the spacing this way I should use a detail section for each Interest and conditionally supress each if its blank.
0
Commented:
I was afraid you were going to say that.  :-)

In the format for a text field, you can go to the Paragraph tab and change the "Text interpretation" to RTF or HTML.  You can then do some fancier formatting by embedding control strings, like HTML tags, within the string.  I'm not sure if that will let you adjust the spacing between the lines in the string, but it might.  For example, you might be able to adjust the spacing that you get from the ChrW (13) by changing the font size before that, and then changing the font size back to normal before the next text field.  Changing the font size is just the first thing that comes to mind.  There may be better ways to handle this using either RTF or HTML tags.

Otherwise, you may have to fall back to using a separate detail section for each field.  If that will work for you, it might be the simplest solution.

James
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
I ended up resolving this by right clicking on the field, going to the format editor, paragraph, and changing the line spacing to a multiple of 1.25 times. That seemed to work.
0
Author Commented:
Thanks.
0
Commented:
Oh.  Duh.  Seems kind of obvious, now that you mention it.  :-)  That's just one of those settings in CR that I've never messed with.  Glad you found a solution, and thanks for letting us know what it was.

James
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.