| Adding line breaks to text fields [message #4088] | 
			Tue, 04 March 2014 06:42   | 
		 
		
			
				
				
				
					
						  
						haider.faraz
						 Messages: 15 Registered: July 2013 
						
					 | 
					Junior Member  | 
					 | 
		 
		 
	 | 
 
	
		I found a workaround within the framework. There are two steps to this: 
 
Step 1: 
Add the line of code $cellspec['text'] = str_replace ( "<br>", chr(10),  $cellspec['text'] );  
 
in the function detailView_multi (&$dbobject, $zone, $current_row)   just below the line $cellspec['text'] = str_replace(' ', $nbsp, $cellspec['text']);  in the file std.pdf.class.inc 
 
Step 2: 
In the cell where one wants to introduce the line break you can introduce the string "<br>" such that for example if you want to print "hello world" but with a line break then you would have to modify the text string to "hello<br>world".
		
		
		
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 | 
	| 
		
 | 
	| 
		
 | 
	| 
		
 | 
	| 
		
 | 
	| 
		
 | 
	
		
		
			| Re: Adding line breaks to text fields [message #4096 is a reply to message #4095] | 
			Wed, 05 March 2014 06:37    | 
		 
		
			
				
				
				
					
						  
						haider.faraz
						 Messages: 15 Registered: July 2013 
						
					 | 
					Junior Member  | 
					 | 
		 
		 
	 | 
 
	
		This must be my mis-understanding of how php works but it is interesting to share with you what I found. 
 
Apparently, the following code does introduce the new line character: 
$str1 = "faraz";
$str2 = "haider";
$str3 = $str1."\n".$str2;
  
while the code that follows next does not: 
$str1 = "faraz";
$str2 = "haider";
$str3 = $str1.'\n'.$str2;
  
		
		
		[Updated on: Wed, 05 March 2014 06:45] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 |