Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Positioning a Field based on a formula Post Reply Post New Topic
Author Message
dkalsow
Groupie
Groupie
Avatar

Joined: 10 Jan 2011
Location: United States
Online Status: Offline
Posts: 65
Quote dkalsow Replybullet Topic: Positioning a Field based on a formula
    Posted: 24 Mar 2011 at 6:19am
Good Morning,
 
Does anyone know how to position a field in crystal based on the previous field starting location, lenghth, and a constant amount of white space?
 
 
Thanks :)
dkalsow
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Mar 2011 at 7:56am
you can use a formula to move the x position of a field.
The x value amount is based on twips- there are 1440 twips in an inch.
 
That being said it might be eaiser to just stick to field together in one formula
IP IP Logged
dkalsow
Groupie
Groupie
Avatar

Joined: 10 Jan 2011
Location: United States
Online Status: Offline
Posts: 65
Quote dkalsow Replybullet Posted: 24 Mar 2011 at 7:59am
so how do I get the position of a specific field?
Thanks :)
dkalsow
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Mar 2011 at 8:05am
right click on the field
there is a size and position option
this gives you x and y in inches so you can multiply it by twips to get the position but the formula moves the field left (negative value) and right positive value relative to it's original starting position.
You will need to calulate the ending position of the field based on length of the data and then move the it around off of that.
IP IP Logged
dkalsow
Groupie
Groupie
Avatar

Joined: 10 Jan 2011
Location: United States
Online Status: Offline
Posts: 65
Quote dkalsow Replybullet Posted: 24 Mar 2011 at 8:07am
that I know, but can I get it using a formula - not hard coding it in?
Thanks :)
dkalsow
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Mar 2011 at 10:07am
you mean you want to know where the right most portion of a word ends based on the length of the word, correct?
The field size does not change so it is not the postion of the field but a position within the field.
you would actually be overlaying your two fields to get them side by side
you will have to calculate postion X to move left as:
(-1) *
(
(starting postion of right field in twips)
-
(starting positon of the left field in twips + the length of the word in twips)
)
to get the length in twips I would make a guess at the size of each character and multiply that by the len(field)
 
the size of each character will vary based on font type, size , bold etc.
but make a guess and move it up or down a bit until you get it right
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.