srinath_b
March 23rd, 2004, 02:22 AM
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
Thanks
|
Click to See Complete Forum and Search --> : How to enter a line feed in a formula field srinath_b March 23rd, 2004, 02:22 AM 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 malleyo March 23rd, 2004, 09:35 AM 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. srinath_b March 24th, 2004, 02:01 AM 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 srinath_b March 25th, 2004, 07:50 AM Please some one help me out with this problem. My project is being held up for implementation just for this problem Help:( :( harmonycitra March 26th, 2004, 01:07 PM 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 srinath_b April 7th, 2004, 06:15 AM 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 . malleyo April 7th, 2004, 09:41 AM 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! srinath_b April 7th, 2004, 02:36 PM 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 harmonycitra April 7th, 2004, 03:57 PM 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. srinath_b April 8th, 2004, 08:31 AM 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:confused: :confused: harmonycitra April 8th, 2004, 11:42 AM 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. harmonycitra April 14th, 2004, 11:20 AM Are u using CR 10? If it is, chr, asc functions are changed and the functions are now chrW, ascW. Try them. srinath_b April 20th, 2004, 04:53 AM I will try them out . But these functions are not there in the function list. thanks i will try and let you know Thanks srinath_b April 29th, 2004, 02:19 AM 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:( :( srinath_b May 29th, 2004, 08:08 AM I am using CR 4.5. There are not any CHR or ASC functions in CR4.5. How can i solve this problem dilemma May 29th, 2004, 04:54 PM 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 srinath_b May 31st, 2004, 05:13 AM 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 :confused: :confused: dilemma June 1st, 2004, 07:21 PM What if your backend deals with this scenario ? What backend you are using ? Thanks srinath_b June 2nd, 2004, 12:42 AM 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 dilemma June 4th, 2004, 10:51 PM 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 srinath_b June 10th, 2004, 11:22 AM 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. srinath_b June 15th, 2004, 12:39 AM 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:wave: :) Asad Naeem July 6th, 2004, 05:29 AM 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 grstephie November 10th, 2004, 12:16 PM 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 pete# August 9th, 2005, 09:07 PM 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:confused: :confused: Make sure you have Crystal Syntax turned on if you are using "+" to concatenate strings, otherwise you will need to use "&". codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved. |