CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25
  1. #16
    Join Date
    May 2004
    Posts
    64
    I think you need both carriage return and linefeed which is chr(10) + char(13). Here is an example

    CRXReport.FormulaFields.Item(1).text = chr(10)+chr(13) & Text1.text & chr(10)+chr(13)

    There are two ways to deal with it.

    1. Have your sql take care of this concatenation with carriage return and line feed. Have sql return address as one field and remaining all as second with carriage return and line feed.

    2. Once done just display address field first and then second field. Check in 4.5 is there a property called can grow. Try disabling it if you could. As these two fields are going to be indendent CR wouldn't have any problem displaying it.

    Thanks

  2. #17
    Join Date
    Dec 2003
    Posts
    54
    Originally posted by dilemma
    I think you need both carriage return and linefeed which is chr(10) + char(13). Here is an example

    CRXReport.FormulaFields.Item(1).text = chr(10)+chr(13) & Text1.text & chr(10)+chr(13)

    There are two ways to deal with it.

    1. Have your sql take care of this concatenation with carriage return and line feed. Have sql return address as one field and remaining all as second with carriage return and line feed.

    2. Once done just display address field first and then second field. Check in 4.5 is there a property called can grow. Try disabling it if you could. As these two fields are going to be indendent CR wouldn't have any problem displaying it.

    Thanks

    I have tried passing the concatenated fields to the formula field in CR 4.5 but to no avail. The CR doesn't recognizes carriage return and line feed. There are also no chr functions the function list in the formula editor. After passing the concatenated to the CR the details come as a single line field.

    CRXReport.FormulaFields.Item(1).text = chr(10)+chr(13) & Text1.text & chr(10)+chr(13).

    The above syntax also doesn't works as there is no FormulaFields property in the CR control i use in my application.


    Help


  3. #18
    Join Date
    May 2004
    Posts
    64
    What if your backend deals with this scenario ? What backend you are using ?


    Thanks

  4. #19
    Join Date
    Dec 2003
    Posts
    54
    I am using MSAccess as my backend. How can we handle this through the backend? I cannot make major changes to the database as i am in my last leg of the project. Because of the change to the database it should not be that i would have to change a lot in my code.

    Thanks

  5. #20
    Join Date
    May 2004
    Posts
    64
    Is this a table based report or SQL based ? If it's a SQL based report then in sql itself concatenate char(10)+char(13).

    eg. select name, code + char(10)+char(13) from table where ..

    Thanks

  6. #21
    Join Date
    Dec 2003
    Posts
    54
    Originally posted by dilemma
    Is this a table based report or SQL based ? If it's a SQL based report then in sql itself concatenate char(10)+char(13).

    eg. select name, code + char(10)+char(13) from table where ..

    Thanks
    It is a table based report and not a sql based report. There are three different fields to be placed one below the other in the last column where as in the column previous to this column there is only one field which is the address field which is mutiline.

  7. #22
    Join Date
    Dec 2003
    Posts
    54
    I think the problem faced by me is solved. Instead of taking the fields directly from the table i have created a query where in i have joined all the fields in the last column with line feed and carriage return. when i place this field in the report i get the desired result.

    Thanks for helping me out and for all the valuable

    suggestion

  8. #23
    Join Date
    Jun 2003
    Location
    Lahore
    Posts
    31

    Formula Field

    Hello
    As far as i understand your problem. Here is the solution: (Try it and do tell me) I have not VS.Net at this time thats why check the syntax urself

    ' First take global variable and place it in the report header
    ' and suppress it (so that it would not display at run time)
    global var as integer
    var = 0
    dim store as integer
    '''''''''''''''''''''''''''''''''''''''''
    ' Then in your formula Field check this variable equal to zero
    if var==0 then
    store = field1 + field2 + field3
    var=1
    else if var==1 then
    store = store + field1 + field2 + field3
    end if

    Best of Luck
    May Allah keep this world Peaceful. (Aameen)

  9. #24
    Join Date
    Nov 2004
    Posts
    2

    Wink Re: How to enter a line feed in a formula field

    Hi, I´m not sure it will work but i try...

    I was thinking and maybe you can separate the address by formulas in order to try the other sugestion.

    You can know the size of the address string by "Length" function. It appears in the Strings' functions. Then if you know how many numbers have the fax and the telephone you substract the quantity and with te "Mid" function you can extract the information.

    Obviously you have to do a formula for each elemento of the address.

    I hope it helps you

  10. #25
    Join Date
    Apr 2005
    Location
    Melbourne, Australia
    Posts
    14

    Re: How to enter a line feed in a formula field

    Quote Originally Posted by srinath_b
    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
    Make sure you have Crystal Syntax turned on if you are using "+" to concatenate strings, otherwise you will need to use "&".
    101010

Page 2 of 2 FirstFirst 12

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

Featured