Hi,
I have requirement in such a way that in a table cell first para of that should be bold and subsequent should not be bold and it should come in bullets i am doing through java and these data are dynamic. I have bookmarked the table and inserting can you please help me with this issue.
I want data to be displayed like this.
The proposal was discussed and advised the Initiator with the following comments:
-
List item1
-
2.List Item 2
-
List item
@Pruthvirajurs,
Please try using the following code:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.startTable();
builder.insertCell();
builder.getFont().setBold(true);
builder.writeln("First Paragraph is bold");
builder.getFont().clearFormatting();
doc.getLists().add(ListTemplate.NUMBER_DEFAULT);
com.aspose.words.List list = doc.getLists().get(0);
// Set true to specify that the list has to be restarted at each section.
builder.getListFormat().setList(list);
for (int i = 1; i < 5; i++)
{
builder.writeln(String.format("List Item " + i));
}
builder.getListFormat().removeNumbers();
// Build the second cell
builder.insertCell();
builder.write("Row 1, Cell 2 Content.");
// Call the following method to end the row and start a new row.
builder.endRow();
// Build the first cell of the second row.
builder.insertCell();
builder.write("Row 2, Cell 1 Content");
// Build the second cell.
builder.insertCell();
builder.write("Row 2, Cell 2 Content.");
builder.endRow();
// Signal that we have finished building the table.
builder.endTable();
// Save the document to disk.
doc.save("D:\\temp\\awjava-17.9.docx");
Hope, this helps.