Hi Aspose team,
I am creating a list like,
1)Section
1.1) Clause
some text in clause
But my output is coming like :
1)Section
Clause
some text in clause
I am using aspose 4.0.2.0 and word-2007
My code snippet is:
public OutputStream buildDocument(List contractSections) throws Exception
{
builder.getListFormat().applyNumberDefault();
for (ContractSectionGeneric sectionInDoc: contractSections)
{
builder.getListFormat().listOutdent();
// builder.getListFormat().getListLevel().setNumberStyle(NumberStyle.ARABIC);
// builder.getListFormat().getListLevel().setNumberFormat("\u0000)");
builder.getListFormat().setList(doc.getLists().get(0));
builder.getListFormat().getList().getListLevels().get(0).setNumberStyle(NumberStyle.ARABIC);
builder.getListFormat().getList().getListLevels().get(0).setNumberFormat("\u0000)");
builder.startBookmark("section_" + sectionInDoc.getId());
builder.setBold(true);
builder.writeln(sectionInDoc.getSectionName());
builder.setBold(false);
List sectionClauses = sectionInDoc.getClauses();
if (sectionClauses != null)
{
for (ContractSectionClausesGeneric clauseInSection: sectionClauses)
{
builder.getListFormat().listIndent();
// builder.getListFormat().getListLevel().setNumberStyle(NumberStyle.ARABIC);
// builder.getListFormat().getListLevel().setNumberFormat("\u0000.\u0001)");
builder.getListFormat().setList(doc.getLists().get(0));
/*
* Comment out next 2 lines bcz these not working in word 2007
*/
builder.getListFormat().getList().getListLevels().get(1).setNumberStyle(NumberStyle.ARABIC);
builder.getListFormat().getList().getListLevels().get(1).setNumberFormat("\u0000.\u0001)");
builder.startBookmark("clause_" + clauseInSection.getId());
String finalHTMLText = "<B>"+clauseInSection.getClauseTitle()+"</B><P>"+clauseInSection.getClauseText()+"</P>";
builder.insertHtml(finalHTMLText);
// builder.insertBreak(BreakType.LINE_BREAK);
builder.endBookmark("clause_" + clauseInSection.getId());
// builder.insertBreak(BreakType.PARAGRAPH_BREAK);
}
}
builder.endBookmark("section_" + sectionInDoc.getId());
// builder.insertBreak(BreakType.PARAGRAPH_BREAK);
}
setDocProperties(doc);
doc.setTrackRevisions(true);
doc.protect(ProtectionType.ALLOW_ONLY_REVISIONS, "1234");
OutputStream outStream = new ByteArrayOutputStream();
doc.save(outStream, SaveFormat.DOC);
return outStream;
}
I will be highly greatfull for you quick response
Thank you!!!