Hello,
I am trying to display a long text in a single page and export it to pdf.
The placeholder is manually placed in an excel or pdf sheet. The code searches the placeholder’s name and sets value accordingly. However, the text is overflowing to next page instead of being wrapped to next line despite there being enough space below the placeholder.
I tried using setTextWrapped but it cuts the text and shows first two or three words of entire text. I think it is only wrapping the text to one cell. When I merge the cells manually from excel and use the setTextWrapped, the texts are cut off in a weird manner.
Code snippet:
Cell LongLoa = cells.find(“LOA_Long”, null, findOptions);
if (LongLoa){
LongLoa.setValue("LOA: ABC, CDE, EFG, GHI & PHI; Class- AAA, BBB, CCC, DDD, EEE & GG; Type- ZZZ001,XXX002,YYY003,TTT004 & PPP005; Gender: F; Extra- uu123,ii123,bb12333,nn1233,gg233322 & dd12223")
Style st = LongLoa.getStyle();
st.setTextWrapped(true);
LongLoa.setStyle(st);
}
Note: In the actual code, value set to LongLoa is dynamic. Hence, the length of LongLoa will be varying.
Attached is an excel file where I am trying to put a long text in LOA_long.
resources.zip (60.8 KB)