Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Parameter Text in a Text Object Post Reply Post New Topic
Author Message
DilbertIsMyHero
Newbie
Newbie
Avatar

Joined: 02 Jan 2009
Location: United States
Online Status: Offline
Posts: 12
Quote DilbertIsMyHero Replybullet Topic: Parameter Text in a Text Object
     Posted: 20 Feb 2009 at 2:26pm

I think I am losing my mind.  I have a text object on my report for the 'From' and 'To' dates on a report.  So that the spacing works between the words, I add a text object to my report and type the word "From" (without quotes).  Then, I drag the start date into the field next to the word From.  Then I type "To" and insert the ending date.

I right justify the contents of the field.  I position the object on the right side of the report (not right at the margins about 1/4" in).

Just above this combined field, is a special field with the print date.  It is also right justified and the two fields are right aligned.
 
The problem is when the report prints, the combined field isn't truly right justified.  There are what appears to be extra spaces in it.  The fields look similar to this...
 
                                                         02/20/2009
        Report range 01/01/2008 to 12/31/2009
 
They should be perfectly aligned when you look at the CR layout.  I have done some testing.  If I remove the text and just leave the dates in the text object, I have the same results.  It looks like it has something to do with the brackets that get placed around the parameter field when it is placed inside the text object.
 
Report range {?datdeb} to {?datfin}
 
Has anyone else run across this?  I have noticed this on several of my reports and decided to try and find a solution.
 
Could it be a variable font issue?  If so, is there a work around?
 
Thanks in advance.
 
Gilley Estes
Gilley Ann Estes
Senior Technical Writer
Welton USA
IP IP Logged
despec99
Newbie
Newbie


Joined: 10 Feb 2009
Online Status: Offline
Posts: 22
Quote despec99 Replybullet Posted: 20 Feb 2009 at 6:49pm
Well, I recreated your report, but my fields are aligning properly.  Is the text field the same size as the print date field?  I don't know why that should matter, but I have no idea why you would be having this problem.

David
IP IP Logged
DilbertIsMyHero
Newbie
Newbie
Avatar

Joined: 02 Jan 2009
Location: United States
Online Status: Offline
Posts: 12
Quote DilbertIsMyHero Replybullet Posted: 21 Feb 2009 at 10:42am
David,
 
Thanks for the reply.  I will double-check the field width.  I agree that I don't think that would play a part, but you never know.
 
I will post my results on Monday.
 
Thanks again,
Gilley
Gilley Ann Estes
Senior Technical Writer
Welton USA
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 23 Feb 2009 at 6:22am
I have had the same thing occur.  They should align and they don't.  Everything was/is the same as far as size of text field, font size, data type.  Makes the report look a bit silly...  I just learned to live with it.
 
Haven't thought of it before, but have you tried 'Justify' instead of Right Alignment.  I haven't, but it is a thought...
 
should have worked the first way...don't get it.
IP IP Logged
DilbertIsMyHero
Newbie
Newbie
Avatar

Joined: 02 Jan 2009
Location: United States
Online Status: Offline
Posts: 12
Quote DilbertIsMyHero Replybullet Posted: 24 Feb 2009 at 10:46am
Angry
It looks like it is a variable sized font issue.  If I select a font such as Lucida Console, which is a fixed sized font, my fields align just perfect.  If I select a font such as Verdana, they are close but not perfect.  If I choose Arial, they are way off.
 
On other reports, I have just adjusted one of the fields until it is aligned in the finished product. 
 
This is crazy.  If you right justify two fields and they are aligned, the text should align.
 
Frustrating.
 
Thanks to all of you who offered suggestions.  If I ever run across a good solution, I will post it.
 
Regards,
Gilley
Gilley Ann Estes
Senior Technical Writer
Welton USA
IP IP Logged
DilbertIsMyHero
Newbie
Newbie
Avatar

Joined: 02 Jan 2009
Location: United States
Online Status: Offline
Posts: 12
Quote DilbertIsMyHero Replybullet Posted: 24 Feb 2009 at 12:19pm
Wink

With the help of one of our programmers, he suggested using a Trim function in case there were extra spaces in the field.  So this is what I ended up doing.

Created a formula with the following:

"Report Range " + Trim (totext({?datdeb})) + " to " + Trim (totext({?datfin}))

?datedeb = beginning date parameter
?datefin = ending date parameter

By using the trim function, the extra spaces that were inserted into the field were removed. 

Go figure!  Oh well... At least there is a solution.

HTH someone in the future...

Gilley

Gilley Ann Estes
Senior Technical Writer
Welton USA
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