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
665 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
  • 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 34

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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 34

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 34

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now