Solved

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

Posted on 2008-10-20
7
669 Views
Last Modified: 2011-10-19
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.
0
Comment
Question by:BostonMA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 4

Author Comment

by:BostonMA
ID: 22758902
Here are two screen shots..
double-spacing.JPG
single-space.JPG
0
 
LVL 35

Expert Comment

by:James0628
ID: 22763517
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
 
LVL 4

Author Comment

by:BostonMA
ID: 22763897
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
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

 
LVL 35

Accepted Solution

by:
James0628 earned 500 total points
ID: 22763990
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
 
LVL 4

Author Comment

by:BostonMA
ID: 22832284
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
 
LVL 4

Author Closing Comment

by:BostonMA
ID: 31507827
Thanks.
0
 
LVL 35

Expert Comment

by:James0628
ID: 22846952
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question