Hi Robin,
Thank you for your patience.
For your requirement, we have prepared the sample and attached to itself. It can be downloaded from the following link.
https://www.syncfusion.com/downloads/support/forum/152430/ze/ASPNetMVC_(3)-341995768
In this sample we done the followings.
1. Created a new Word document instance.
2. Added one section and one paragraph with some text.
3. Added another section with 2 columns
4. Added string list with bullet points in both columns.
5. Added another section at the end of columns.
6. Saved and closed the word document instance.
To know more about multicolumn section and list numbering, please refer the following links.
https://help.syncfusion.com/file-formats/docio/working-with-sections#creating-multi-column-document
https://help.syncfusion.com/file-formats/docio/working-with-paragraph#working-with-lists
Please let us know if you have any other questions.
Regards,
Manikandan Ravichandran
Thank you for your sample project. However have few issues
1) The data has long words e.g. Local Aid Programs Office/Division. The list is wrapping the word into next line. How do I avoid this and show the data on the same line
2) The data has two lists. Please provide a sample project with looping through the list and showing the multi bullet columns
List 1
· Operations
· Planning
· Traffic Engineering/Safety
|
//Adds the first column into the section section.AddColumn(270, 5); //Adds the second column into the section section.AddColumn(230, 5); |
List 1
|
for (int i = 0; i < list1.Count; i++) { //Adds new paragraph to the section paragraph = section.AddParagraph(); //Applies default numbered list style paragraph.ListFormat.ApplyDefBulletStyle(); //Adds text to the paragraph paragraph.AppendText(list1[i]); //Continues the list defined paragraph.ListFormat.ContinueListNumbering(); } paragraph = section.AddParagraph(); paragraph.AppendBreak(BreakType.ColumnBreak); for (int j = 0; j < list2.Count; j++) { paragraph = section.AddParagraph(); //Applies default numbered list style paragraph.ListFormat.ApplyDefBulletStyle(); //Adds text to the paragraph paragraph.AppendText(list2[j]); //Continues the list defined paragraph.ListFormat.ContinueListNumbering(); } section = document.AddSection(); section.BreakCode = SectionBreakCode.NoBreak; |
|
WordDocument document = new WordDocument(); //Adds the section into Word document IWSection section = document.AddSection(); IWParagraph paragraph = section.AddParagraph(); section.BreakCode = SectionBreakCode.NoBreak; //Adds the column into the section section.AddColumn(250, 5); //Adds the column into the section section.AddColumn(250, 5); paragraph = section.AddParagraph(); paragraph.AppendHTML("<div><ul><li>Left Item 1</li><li>Left Item 2</li><li>Left Item 3</li><li>Left Item 4</li><li>Left Item 5</li></ul></div>"); paragraph = section.AddParagraph(); paragraph.AppendBreak(BreakType.ColumnBreak); paragraph = section.AddParagraph(); paragraph.AppendHTML("<div><ul><li>Right Item 1</li><li>Right Item 2</li><li>Right Item 3</li><li>Right Item 4</li><li>Right Item 5</li></ul></div>"); section = document.AddSection(); section.BreakCode = SectionBreakCode.NoBreak; document.Save("Output.docx"); document.Close(); |