Bullet lists are a common way to display collections of items in documents. GroupDocs.Assembly for .NET makes it easy to generate bulleted lists by iterating over data collections using foreach data bands within list structures.
usingGroupDocs.Assembly;usingSystem.Collections.Generic;publicstaticvoidGenerateBulletListInSpreadsheet(){List<Product>products=newList<Product>{newProduct{Name="Laptop",Description="High-performance laptop"},newProduct{Name="Mouse",Description="Wireless mouse"}};DocumentAssemblerassembler=newDocumentAssembler();assembler.AssembleDocument("BulletListTemplate.xlsx","BulletListOutput.xlsx",newDataSourceInfo(products,"products"));Console.WriteLine("Bullet list generated in spreadsheet successfully.");}
Bullet List in Email
Generate bullet lists in email messages:
usingGroupDocs.Assembly;usingSystem.Collections.Generic;publicstaticvoidGenerateBulletListInEmail(){List<Product>products=newList<Product>{newProduct{Name="Laptop",Description="High-performance laptop"},newProduct{Name="Mouse",Description="Wireless mouse"}};DocumentAssemblerassembler=newDocumentAssembler();assembler.AssembleDocument("BulletListTemplate.msg","BulletListOutput.msg",newDataSourceInfo(products,"products"));Console.WriteLine("Bullet list generated in email successfully.");}
Warning
In Word documents, ensure the bullet list formatting is applied in the template. The foreach data band will repeat the list item format for each collection element.
Advanced Usage Topics
To learn more about nested bullet lists, conditional list items, and advanced list formatting, please refer to the advanced usage section.
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: