on 08-23-2011 10:14 PM
I am using receiver mail adapter. Everything is working fine. Mail content has several fields, which are concatenated into 'content'. But the users want to see the content of the email in several lines (rather than one string). I tried to change the occurrence of node 'content' in mail message, but it did not work.
Any idea how it can work?
Thanks!
Hi !
You can use the following UDF to create a new line in your content.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I tested yiur suggested solution and it worked fine for 3 lines. But when I tried it with 10 lines (which is my actual requirement), it is not forcing line split after line 3. below is the code of mu UDF. Can you please check this and suggest:
StringBuffer workArea=new StringBuffer();
workArea.append(var1);
workArea.append("\n");
workArea.append(var2);
workArea.append("\n");
workArea.append(var3);
workArea.append("\n");
workArea.append(var4);
workArea.append("\n");
workArea.append(var5);
workArea.append("\n");
workArea.append(var6);
workArea.append("\n");
workArea.append(var7);
workArea.append("\n");
workArea.append(var8);
workArea.append("\n");
workArea.append(var9);
workArea.append("\n");
workArea.append(var10);
workArea.append("\n");
String result=new String(workArea);
return result;
Hi !
Instead of using 10 line coding for making 10 newlines better u can change my above coding as given below. Try this i think this will help u.
public String insertNewLine(String input1,String input2,String input3,String input4,String input5,String input6,String input7,String input8,String input9,String input10,Container container) throws StreamTransformationException{
StringBuffer workArea=new StringBuffer();
workArea.append(input1"\n"input2"\n"input3"\n"input4"\n"input5"\n"input6"\n"input7"\n"input8"\n"input9"\n"input10);
workArea.append("\n");
String result=new String(workArea);
return result;
}
Regard's
Preethi.
I dont think the string you suggested would work as I got syntax error. I however tried this one, bit it is still coming up with same results ie split happens only upto 3 lines and the rest 7 lines are concatenated.
workArea.append(var1"\n"var2"\n"var3"\n"var4"\n"var5"\n"var6"\n"var7"\n"var8"\n"var9"\n"var10);
workArea.append("\n");
Any suggestions
HI!
I have missed the '+' symbole between "\n" and the variable added it and try. Add it for each variable take the input1 as an example and try it.Hope it will help u.
StringBuffer workArea=new StringBuffer();
workArea.append(input1"\n"input2"\n"input3"\n"input4"\n"input5);
workArea.append("\n");
String result=new String(workArea);
return result;
Regard's
Preethi.
I am still struggling with it. Below is complete code. Split is happening only upto 3 lines and all remaining ones are in a continous string. I appreciate your help. Can you sugegst what am I missing?
StringBuffer workArea=new StringBuffer();
workArea.append(var1 + "\n" + var2 + "\n" + var3 + "\n" + var4 + "\n" + var5 + "\n" + var6 + "\n" + var7 + "\n" + var8 + "\n" + var9 + "\n" + var10);
workArea.append("\n");
String result=new String(workArea);
return result;
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.