CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual Basic Programming > Crystal Reports
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old March 23rd, 2004, 02:22 AM
    srinath_b srinath_b is offline
    Member
     
    Join Date: Dec 2003
    Posts: 54
    srinath_b is an unknown quantity at this point (<10)
    How to enter a line feed in a formula field

    I want to concatenate 3-4 fields in a formula field. The problem is i want each and every field in the next line. How can you insert a line feed in a formula field?

    Thanks
    Reply With Quote
      #2    
    Old March 23rd, 2004, 09:35 AM
    malleyo malleyo is offline
    Member +
     
    Join Date: Jul 2003
    Location: Florida
    Posts: 651
    malleyo has a spectacular aura about (125+)malleyo has a spectacular aura about (125+)
    Don't know if this will help, but I'll try...

    I'm using Crystal Reports 8.5. If I have a text field and a Database Field, all I have to is drag and drop the Database field onto the Text Field and they will be merged into one. You have to get it at the exact location in order for it to place one field inside another, otherwise it will just be placed on top of the other field. Keep playing around with it and you'll get it eventually.
    __________________
    I'd rather be wakeboarding...
    Reply With Quote
      #3    
    Old March 24th, 2004, 02:01 AM
    srinath_b srinath_b is offline
    Member
     
    Join Date: Dec 2003
    Posts: 54
    srinath_b is an unknown quantity at this point (<10)
    Quote:
    Originally posted by malleyo
    Don't know if this will help, but I'll try...

    I'm using Crystal Reports 8.5. If I have a text field and a Database Field, all I have to is drag and drop the Database field onto the Text Field and they will be merged into one. You have to get it at the exact location in order for it to place one field inside another, otherwise it will just be placed on top of the other field. Keep playing around with it and you'll get it eventually.

    I am using Crystal Reports 4.5, Every field is a database field. I want to concatenate every field into a formula field such that every field starts at a new line.
    If i place each field one below the other what happens is if the previous column in the report is multiline the placing of the fields in the last column where i have placed the fields one below the other becomes disturbed, with the first line taking the same number of lines as the previous column and then the other details are placed. I want the last column to be printed in the way I have placed the fields without bothering about the number of lines being taken by the previous column.

    Thanks
    Reply With Quote
      #4    
    Old March 25th, 2004, 07:50 AM
    srinath_b srinath_b is offline
    Member
     
    Join Date: Dec 2003
    Posts: 54
    srinath_b is an unknown quantity at this point (<10)
    Please some one help me out with this problem. My project is being held up for implementation just for this problem

    Help
    Reply With Quote
      #5    
    Old March 26th, 2004, 01:07 PM
    harmonycitra harmonycitra is offline
    Member
     
    Join Date: May 2003
    Posts: 163
    harmonycitra is on a distinguished road (20+)
    U can insert a line feed/carriage return by inserting chr(13) in your selection formula

    ex:

    StringVar x:= "Title for the Cross-Tab" + Chr(13) + "Period from Year X to Year Y"

    Hope this will work
    Reply With Quote
      #6    
    Old April 7th, 2004, 06:15 AM
    srinath_b srinath_b is offline
    Member
     
    Join Date: Dec 2003
    Posts: 54
    srinath_b is an unknown quantity at this point (<10)
    my problem is in the second column i have an address field and it is a multiline field. in the third column i have set the tel fax email fields one below the other so that for one record the details of the address and the tel details etc fall on the same line. But the problem is since the address field is a multi line field the telephone field takes the the same size as the address field and the remaining fields come below that. I want the tel, email fax details one below the other irrespective of the size the address field takes.
    Please help me .
    Reply With Quote
      #7    
    Old April 7th, 2004, 09:41 AM
    malleyo malleyo is offline
    Member +
     
    Join Date: Jul 2003
    Location: Florida
    Posts: 651
    malleyo has a spectacular aura about (125+)malleyo has a spectacular aura about (125+)
    Can the address field be broken down into it's separate parts? For example, when I store an address, I store the Street Name and Number in one column, the City in another column, the State in a third column, and the ZipCode in a fourth column. Then I make a multiline text object and drop the fields into the text object in the order that I need them. See the attached image. I also don't know if 4.5 supports the drag and drop like 8.5 does.

    Hope that helps!
    Attached Images
     
    __________________
    I'd rather be wakeboarding...
    Reply With Quote
      #8    
    Old April 7th, 2004, 02:36 PM
    srinath_b srinath_b is offline
    Member
     
    Join Date: Dec 2003
    Posts: 54
    srinath_b is an unknown quantity at this point (<10)
    Thanks I got your point. But the address field cannot be broken in to smaller fields. Is there any other way. the formula editor doesn't supports chr function. Even if i pass it through a string function it comes in the same line and then after the field size is met moves to the next line. Is there any way we can call th CHR function in the formula editor

    Thanks
    Reply With Quote
      #9    
    Old April 7th, 2004, 03:57 PM
    harmonycitra harmonycitra is offline
    Member
     
    Join Date: May 2003
    Posts: 163
    harmonycitra is on a distinguished road (20+)
    Chr(13) works fine when inserting within a formula.

    ex
    left({?inp string},3) & chr(13) & mid({?inp string},4,3)

    Try to figure out how many chars are taken for telephone, fax, email (use some string functions to know where they are in a lengthier string) and then use chr(13) in between them.
    Reply With Quote
      #10    
    Old April 8th, 2004, 08:31 AM
    srinath_b srinath_b is offline
    Member
     
    Join Date: Dec 2003
    Posts: 54
    srinath_b is an unknown quantity at this point (<10)
    I am sorry to say but i tried using chr(13) in the formula editor but it doesn't works. when i check the formula it says string,numeric,currency or boolean required at the point where i have entered chr(13). Folllowing is the code entered in the formula editor.

    "Tel No : " + {Supplier.TelNo} + chr(13) + " Fax No :" + {Supplier.Fax}

    If chr(13) is accepted in the formula editor then there will be no problem. I can directly concatenate the database fields and where ever the field should be in the next line i can enter a line feed.

    Help
    Reply With Quote
      #11    
    Old April 8th, 2004, 11:42 AM
    harmonycitra harmonycitra is offline
    Member
     
    Join Date: May 2003
    Posts: 163
    harmonycitra is on a distinguished road (20+)
    Strange!!!!
    The same thing works for me. Are Tel ph, fax no fields are string / numeric.

    Sorry, these may be idiotic ideas,

    If they are numeric (hope it's not), try to convert them as string and try to use & instead + (not must, both will work)

    Otherwise try to select the chr function from the function tree instead of typing it.

    Last edited by harmonycitra; April 8th, 2004 at 11:44 AM.
    Reply With Quote
      #12    
    Old April 14th, 2004, 11:20 AM
    harmonycitra harmonycitra is offline
    Member
     
    Join Date: May 2003
    Posts: 163
    harmonycitra is on a distinguished road (20+)
    Are u using CR 10?

    If it is,

    chr, asc functions are changed and the functions are now chrW, ascW.

    Try them.
    Reply With Quote
      #13    
    Old April 20th, 2004, 04:53 AM
    srinath_b srinath_b is offline
    Member
     
    Join Date: Dec 2003
    Posts: 54
    srinath_b is an unknown quantity at this point (<10)
    I will try them out . But these functions are not there in the function list. thanks i will try and let you know

    Thanks
    Reply With Quote
      #14    
    Old April 29th, 2004, 02:19 AM
    srinath_b srinath_b is offline
    Member
     
    Join Date: Dec 2003
    Posts: 54
    srinath_b is an unknown quantity at this point (<10)
    Quote:
    Originally posted by harmonycitra
    Are u using CR 10?

    If it is,

    chr, asc functions are changed and the functions are now chrW, ascW.

    Try them.
    I am using Chr(10). I have tried out the above suggestion also but the same error persists. I am working with crystal reports 4.6.
    The above functions doesn't exists in the function box in the formula editor.

    I have tried to post the data from the application but the details are shown one after the other without linefeed.

    Help
    Reply With Quote
      #15    
    Old May 29th, 2004, 08:08 AM
    srinath_b srinath_b is offline
    Member
     
    Join Date: Dec 2003
    Posts: 54
    srinath_b is an unknown quantity at this point (<10)
    I am using CR 4.5. There are not any CHR or ASC functions in CR4.5. How can i solve this problem
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual Basic Programming > Crystal Reports


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 04:27 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009