I'm generating a word document using Aspose.Words(Evaluation mode) for .Net in which I'm building a table as following
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Table table = builder.StartTable();
for (int i = 0; i < 5; i++)
{
for(int j = 0; j < 20; j++)
{
builder.InsertCell();
builder.Write("Column : "+ j.toString());
}
builder.EndRow();
}
builder.EndTable();
doc.Save(ms, Aspose.Words.Saving.SaveOptions.CreateSaveOptions(SaveFormat.Doc));
FileStream file = new FileStream(@"c:\NewDoc.doc", FileMode.Create, FileAccess.Write);
ms.WriteTo(file);
file.Close();
ms.Close();
Now this code gives following word file with invisible columns, it should give 20 columns
.
Is there any way to break invisible columns to next page?
Rows can go to next page, not columns, it is the behavior of Microsoft Word. You can change the design and formatting of the document to make all columns visible. Below are few pointers.
Check the related articles and code sample on Aspose.Words documentation website.
Try the updated code sample below:
I work with Aspose as a Developer Evangelist.