Crystal Report help!!!! PLEASE

Okay,

I am currently making a mailing letter in Crystal Report that will be auto filled by my database. Here is what I am running into. I have set my database up to collect and store the indivuals first name and last name in seperate fields. What I am trying to do is make it to where I don't have alot of spaces whenever I between my FirstName and LastName in the crystal report.

For example: (This is what I want it to look like)

Joe Dirt
12345 Summit Drive
Test, GA 789456

Dear Joe Dirt,

(This is what I DON'T want it to look like)

Joe Dirt
12345 Summit Drive
Test , GA 789456

Dear Joe Dirt,

** My fields in in Crystal Report have to be so big because I want every name to fit inside them. Is there any way to make the field auto ajust

Can someone please help me. I have been stuck on this lately. PLEASE!



Answer this question

Crystal Report help!!!! PLEASE

  • Andreas Asterlund

    In the field explorer there is a node named Formula Fields.

    • Create a new field by right-clicking -> new
    • Name it whatever you want and select to use the editor
    • Enter the formula something like: Trim({DS.FirstName}) + " " + Trim({DS.LastName})
    • Save and Close
    • Expand the Formula fields node
    • Drag the new formula field on your report.

    Charles


  • dan8976

    Okay, how do i go about doing this


  • MrWave

    Hi,

    You can use the Trim function to remove the trailling whitespace.

    Regards,
    Charles


  • Puzzled

    you can do like this.

    select rtrim(first_name) from <table Name>

    it will trim the extra spaces from first name,

    or you can do like this

    select rtrim(first_name) + ' ' + rtrim(last_name) as name from <table Name>



  • YeeBoon

    cverdon wrote:

    If you want to use the CR Trim function just change your formula (expression) from something like

    = DS.FirstName + " " + DS.LastName

    to something like

    = Trim(DS.FirstName) + " " + Trim(DS.LastName)

    Charles

    How do i put the = DS.FirstName + " " + DS.LastName in the Crystal Report

    F.Y.I.
    I am brand new to Crystal Reports, and also I am creating this report inside VB.NET 2005


  • Alikas

    If you want to use the CR Trim function just change your formula (expression) from something like

    = DS.FirstName + " " + DS.LastName

    to something like

    = Trim(DS.FirstName) + " " + Trim(DS.LastName)

    Charles


  • Fred Herring

    you have to configure your sql string /store procedure (which you are using to retrive data) by triming the fields to avoid this problem.

  • Crystal Report help!!!! PLEASE