INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

how to split sentence text to wrap properly.

how to split sentence text to wrap properly.

(OP)
Hi,

Crystal Reports 2011 SP7. I have an report input parameter where the user can enter text. The desired presentation is to show the text as indented bullet items. Since the Crystal Input Parameters do not support multiple line input parameters, I devised a scheme to have the user precede each bullet line with a plus sign character. I have a formula that uses the replace function to replace the plus sign with Carriage Return, Carriage Return, Tab, Bullet, Tab.

CODE -->

Replace({?bullet_input}, "+", ChrW(13) + ChrW(13) + ChrW(9) + ChrW(9679) + ChrW(9)) 

This works great, however, if the bullet text wraps to the next line, the next line's text does not indent to where the bulleted text begins.

For example:
Input text:
+ Try a thing you haven’t done three times. Once, to get over the fear of doing it. Twice, to learn how to do it. And a third time, to figure out whether you like it or not. + Courage is not the absence of fear, but rather the judgement that something else is more important than fear.

Desired output:
  • Try a thing you haven’t done three times. Once, to get over the fear of doing it. Twice, to learn how to do it. And a third time, to figure out whether you like it or not.
  • Courage is not the absence of fear, but rather the judgement that something else is more important than fear.
Actual Report Output:

____+_Try a thing you haven’t done three times. Once, to get over the fear of doing it. Twice, to learn how to do it. And a third time, to figure out whether you like it or not.
____+_Courage is not the absence of fear, but rather the judgement that something else is more important than fear.

NOTES:
1. See how the wrapped bulleted text does not align below the text above it, it left justifies.
2. I used underscores to represent spaces and plus signs to represent bullets since the HTML in this forum will not display these characters.

I think I need to Split the text for each bullet on a space character based on the maximum number of characters that can fit on a bulleted line. In my case the bullet line wraps at 95 characters, so I think I need to find the last space in the text at less than 95 and insert a CR and a couple TABS.

I appreciate any suggestions on how to implement this.

P.S. I can't believe that Crystal Reports does not support multiple line text input.

Thanks,

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close