Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: fields aligment issue Post Reply Post New Topic
Author Message
valdam
Newbie
Newbie


Joined: 13 Feb 2012
Location: Italy
Online Status: Offline
Posts: 4
Quote valdam Replybullet Topic: fields aligment issue
     Posted: 13 Jun 2012 at 10:47pm
hi all, I've an issue that seemd easy to solve but it's not, for me at least.
I've two formula fields in a group footer section: Field A, which is a multiline field, and field B, which is not a multiline field.
Field B is placed at the right of the multiline field A, of which I don't know the number of lines, which is different per each row.
When the report is generated I would like field B to be aligned with the last line of the multiline fild A. so...not under the last line of field A (which it would implies the use of another section under the one I'm using) but at the same hight of the last line of field A.

the output I want to gain follows:

line1 of field A
line2 of field A
line3 of field A
line4 of field A
line5 of field A     line1 of field B


thank you in advance
Regards
valdam
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 14 Jun 2012 at 3:28am
This is a tough one - there is no automatic ability to do this. 
Are there carriage returns between the lines in field A or is the growth due to word wrap?  Or is it a combination of both?
 
If it's based on carriage returns, then it's pretty easy - you just count them and create a formula that adds that many (chr(13) + chr(10)) to the beginning of field B.
 
Otherwise you have to determine the average number of characters in a row in the display of field A.  Then get the length of field A and determine how many CR/LF's to add to the front of field B.  However, because of the way proportional fonts work (each character is a different width) this will not guarantee that field B will always be at the last line of field A.  There will be times when it is a line above the last line of A and others where it will be a line below.
 
-Dell
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 14 Jun 2012 at 3:59am
Originally posted by hilfy

This is a tough one - there is no automatic ability to do this. 
Are there carriage returns between the lines in field A or is the growth due to word wrap?  Or is it a combination of both?
 
If it's based on carriage returns, then it's pretty easy - you just count them and create a formula that adds that many (chr(13) + chr(10)) to the beginning of field B.
 
Otherwise you have to determine the average number of characters in a row in the display of field A.  Then get the length of field A and determine how many CR/LF's to add to the front of field B.  However, because of the way proportional fonts work (each character is a different width) this will not guarantee that field B will always be at the last line of field A.  There will be times when it is a line above the last line of A and others where it will be a line below.
 
-Dell
 
You could use a monospaced font such as courier to combat the varying character width issues, however the word-wrapping at different points of a line could aslo cause similar issues.
 
Regards,
Ryan.


Edited by rkrowland - 14 Jun 2012 at 4:01am
IP IP Logged
valdam
Newbie
Newbie


Joined: 13 Feb 2012
Location: Italy
Online Status: Offline
Posts: 4
Quote valdam Replybullet Posted: 14 Jun 2012 at 4:05am
thank you all for your reply.
the growth is due to word wrap. so...unless i'll be allowed to use monospacefont like courernew and make the wrapping myself, I think i'll report that this stuff can not be done...properly.

regards and thanks again.

Edited by valdam - 14 Jun 2012 at 4:15am
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum