Results 1 to 12 of 12

Thread: new line in crystal report

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    new line in crystal report

    we use "vbnewline" in our vb to put one line in text.
    how to put it in crystal report through coding ?
    WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST

  2. #2
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    476

    Re: new line in crystal report

    Try Chr(13) or some use Chr(13) + Chr(10)

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    Re: new line in crystal report

    sorry but it does not work.
    WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: new line in crystal report

    sorry but it does not work.
    Yeah, that is helpful. Maybe if you explained your problem a little better.

    Chr(13) does work but you need to set the Can Grow option of the reporting object. For example

    {Customers.CompanyName} + chr(13) + {Customers.ContactTitle}

  5. #5
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    476

    Re: new line in crystal report

    Should've seen that myself brucevde. I have my defaults to Grow 0 automatically so I forgot about that one.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    Re: new line in crystal report

    i set property cangrow as true but still not working it gives space instead of new line.
    WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST

  7. #7
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    476

    Re: new line in crystal report

    Do you want an actual line drawn on the page or do you wish to have more space available to show the text as two lines? I've never tried setting the property cangrow from code but in Crystal, it requires a numeric parameter not boolean since you can specify how many lines it will max out.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    Re: new line in crystal report

    i dont want to draw line.I want my text as in 2/3 lines it depends upon database structure.
    For example i want to display address of customer i hv stored address in different fields in my db.
    so i want to place it in this way, addr1 + newline + addr2 + addr3 + city + country
    WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST

  9. #9
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: new line in crystal report

    try using
    Code:
    addr1 & chr(10) & chr(13) &  addr2 & chr(10) & chr(13) & addr3 & chr(10) & chr(13) & city & chr(10) & chr(13) & country

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    Re: new line in crystal report

    sorry but not working.
    WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST

  11. #11
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: new line in crystal report

    li'll suggestion, try the above methods in a new report (not the existing ones) and post the results. Also use a Formula Field and not the actual Fields.
    Good luck

  12. #12
    Fanatic Member aconybeare's Avatar
    Join Date
    Oct 2001
    Location
    UK
    Posts
    772

    Re: new line in crystal report

    Hi,

    I realise that this is a very old thread but I've had a very similar problem and wanted to add my solution since one hasn't been provided yet -

    If you have "Text Interpretation" set to HTML for the object as I did you must use the "<br>" to add carriage returns.

    For Crystal XI -
    On the report; right click the object - Format Field - Paragraph tab - Text Interpretation frame at the bottom
    There is no Text Interpretation for text boxes, drag a function onto your report and size it accordingly.

    Please note that there appears to be a bug if you try to add multiple breaks, the workaround is to add a white space between your breaks -

    Code:
    ' I'm using basic syntax
    Dim sOut As String
    
    sOut=sOut & "The quick brown fox<br>"
    sOut=sOut & " <br>" ' The space is important as the break is ignored otherwise!
    sOut=sOut & "jumped over the lazy dog."
    
    Formula=sOut

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width