Hello, I am trying to write a table in my Word Template, but when I change the template, the table was created on the same place.
I was looking for the tag , but I realized what is the paragraph, is ther a way to do this with a function.
Here part of my code:
DocumentBuilder built = new DocumentBuilder(doc);
built.moveToParagraph(74,0);
//Headers
built.insertCell();
built.getRowFormat().setHeight(12.0);
built.getRowFormat().setHeightRule(HeightRule.length);
// built.getCellFormat().getShading().setBackgroundPatternColor(Color.BLUE);
built.getParagraphFormat().setAlignment(ParagraphAlignment.CENTER);
built.getFont().setSize(10);
built.getFont().setName(“Calibri”);
built.getFont().setBold(true);
// built.getRowFormat().setHeight(HeightRule.AUTO);
built.getCellFormat().setWidth(12.0);
built.write(“NIVEL”);
built.insertCell();
built.write(“COMPONENTE”);
built.insertCell();
built.write(“CLASE”);
built.insertCell();
built.write(“BIBLIOTECA”);
built.insertCell();
built.write(“SISTEMA”);
built.insertCell();
built.write(“DOCUMENTO”);
built.endRow();
built.getRowFormat().setHeight(30.0);
built.getRowFormat().setHeight(HeightRule.AUTO);
.
.
.
.
the part to tells the cursor where to write the table I know its built.movetoParagraph();
when i try
String fullDoc=doc.getRange().getText();
String tagTab="";
int index=fullDoc.indexOf(tagTab);
…
…
built.moveToParagraph(index,0);
…
…
I´ve got this message error
" java.lang.IllegalArgumentException: Parameter name: paraIdx"
Thanks !