Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Space Alignment on second line of sentence

Status
Not open for further replies.

Balaji07

Technical User
Jan 10, 2018
9
BH
Hello Experts,

When i pull text based value from a database field with bullets the space alignment on second line of sentence required . Formula which will help would be great . I am using crystal report 2013


text_iwzia1.jpg



Regards:
Bala
 
Crystal is not very good with text formatting.

You can try two things

Use a formula to add the required HTML meta data to text and then view the formula as HTML, Format text to use HTML iterpretor

Or
Remove bullet points from text. Formula Mid (yourtextfield, 3, 1000) replace 1000 with max length of field.
Then just place text in a text box which is indented. Then using Wingdings add another text box which replicates the bullet style you want

Ian
 
Hi Ian,

Thanks for response. I may try your 1st point such as converting HTML meta data to text and view the formula as HTML.
The user copy a text of paragraph some with bullets from pdf or word then paste in a field which is a character type before paste user will change the phrases. This text i am trying to display again through PDF using crystal report. So when the displaying the sentence breaks to second line and third line based on length so now the starting word of second , third lines starts from margin without the space.
 
Hi Ian,

Tried the first option but it as no impact on spacing for subsequent line of a single sentence.
 
Hi Ian

I am trying for the space of subsequent lines.

bullet_cknf6q.jpg
 
I know what you want but unfortunately I can not think of any other solution.

You could try using rtf interpretation but again I do not know if that supports indented bullets

Ian
 
Hi Ian,

thanks for support. Waiting if some could give a solution if they had come across same scenario.

regards:
Bala
 
If bullets are not always there. Then I think the easiest solution is to standardise on NO Bullets. That is strip them out when present and solve the problem that way. Crystal is not really a document editor, its a report generator. Clue in the name (Crystal Reports).

I have produced some good customer documents for insurance companies but I have to work within the limitations of Crystal functionality.

Ian
 
Hi Ian,

I tried without formula and as per your earlier formula. still spacing in subsequent line is varying.

Without Formula
Without_formula_txs5fu.jpg


With Formula
with_formula_axbxnj.jpg



Regards:
Bala
 
Balaji,

Your formula output looks pretty good. I see that when the text wraps it is not indenting as far as you want. I think that is the issue you are having.

I wrestled with this and ended up coding my formula to break up the text into individual words in an array and then I determine how many words I can put on a line [based on a fixed line width I came up with]. Then, when I had to insert a break, I also inserted the tab character.

Here are some key pieces of my formula:

WrapLength := 100;
NumLFsBetweenBullets := 2;


// split text into array of words
word_array := split(text_field, " ");

WordCount := count(word_array);
For x := 1 To WordCount Do
(
new_text := new_text + word_array[x] + " ";
NewBulletLen := Length(new_bullet_text);
If x < WordCount then
(
If (NewBulletLen + Length(word_array[x+1]) - WrapLen) >= WrapLength then
(
WrapLen := NewBulletLen - Length(word_array[x+1]);
new_text := new_text + ChrW(13) + ChrW(9) + " ";
)
)
);

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top