thuliobuarque / java2word

Automatically exported from code.google.com/p/java2word
0 stars 0 forks source link

Table style & Cell with a tab before text (after creating image in previous row) #61

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What web framework and version are you using (Struts1, Struts2, Spring,
JBoss Seam)?
None. Just trying to create a simple application.

Did you download j2w-ejb-2.0.zip or built from the source code?
java2word-3.0_2011Aug02.jar

Which web server did you deploy your .WAR (Tomcat, JBoss)?
NA.

Are you using Maven or Ant?
NA.

What is your Operational System?
Windows XP

What steps will reproduce the problem?
1. Creating alternate rows of image and text
2.
3.

Please provide any additional information below.
I'm trying to creating multiple rows of a table, alternating a local image and 
some text (paragraph with pieces). A tab will always happen before my text.

Also, would like to ask if it is possible to have breakline in my paragraph 
(with pieces) within a table cell. The "BreakLine" created only seems to work 
my being added to the "IDocument" directly. 

Would also like to check if it is possible to set the table size to fit the 
page. The table is following the size of my image instead of the page.

My output file is as attached.

Original issue reported on code.google.com by twinks...@gmail.com on 18 Sep 2011 at 6:35

GoogleCodeExporter commented 8 years ago
I think you can add a breakline anywhere. 

try to do a breakline.getContent(), get the return of this method and add 
inside a table cell. I think I tried this long time ago and worked. Pls let us 
know how you go.

You can do the same with other elements. The method getContent() return the XML 
string that represents the element. Most elements will accept this string.  

That's why java2word was designed based on Composite pattern (or something 
similar).

Leonardo  

Original comment by leonardo...@gmail.com on 22 Sep 2011 at 12:43

GoogleCodeExporter commented 8 years ago
Alright, the breakline works with plain text.
Guess I was too much by trying to format my text with different styles using 
ParagraphPiece in the table =)

Original comment by twinks...@gmail.com on 3 Oct 2011 at 6:19

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Hi,

I used Breakline I can remove the space at the beginning but the format of the 
paragraph piece is getting changed.

      tbl.addTableEle(TableEle.TD, Paragraph.withPieces(ParagraphPiece.with(BreakLine.times(1).create()+"Project Overview:").withStyle().bold().create()).getContent(),""); 

This is how I used Leonardo but I am losing the bold property of the text.

Thanks,
Phani

Original comment by phanindr...@gmail.com on 13 Oct 2011 at 2:14

GoogleCodeExporter commented 8 years ago
Hey Phani, 
    I tried this using Breakline in Table Element. But it didn't work. It's returning something like this 
word.w2004.elements.BreakLine@13e205fProject Overview:

Original comment by yashwant...@gmail.com on 1 Jan 2013 at 6:50