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
670 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

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

690 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