Want to Take ASP.NET Datagrid/ DataTable Value in MSWord

Hello I am passing the DataTable to BuildReport Function

How To Take datatable value in MS Word
IF table contains mulitple row the automatically numbering done how to do this pelase provide me the sample code

Pass value to function
Public Function buildReport( ByRef dtTreatment As DataTable) As Document

if datable contains

  1. Rahul M
  2. Kailash B
  3. Nitin P

Diplay like above

How to do this help me urgent Using vb.net

Thansk
Regards
Rahul M

Hi

Thanks for your inquiry. Please follow the link to learn how to build table programmatically:
https://docs.aspose.com/words/net/introduction-and-creating-tables/
Best regards.

hello my problem is solve dear by using following code thanks for reply

For Each DataRow In table.Rows
    builder.Writeln(DataRow(6).ToString)
Next

Just give the simple loop but one problem is how to add the bullets and numbering to each record

eg.

  • rahul
  • mahajan
  • niting
  • patil

How to add tell me urgent

Hi

Thanks for your inquiry. Please follow the link to learn how to insert list into the word document:
https://docs.aspose.com/words/net/working-with-lists/
Best regards.

Hello Dear m trying this but it giving bullet like this

Pest(s):

Lady Beetle (Coccinellidae)

  • Onion maggot (Delia antiqua)

and code is like this

For Each DataRow In table.Rows
    builder.ListFormat.ApplyBulletDefault()
    builder.Writeln(DataRow(7).ToString)
Next

where m wrong dear i trying builder.ListFormat.ApplyBulletDefault() outside of for loop but giving same result. why this happen m not getting ?

Thanks for your inquiry.

  1. You should move ApplyBulletDefault outside the loop. There is no need to call this method each time when you insert new paragraph.
  2. Please read the documentation to learn how to specify formation of lists and other document elements.
    https://reference.aspose.com/words/net/aspose.words.lists/listformat/listlevel/

Best regards.

Hellllo

I hv one problem the bullet is not listing properly the bullet is diplay like this. The first bullet is not properly alignment .

Lady Beetle (Coccinellidae)

  • Onion maggot (Delia antiqua)
  • abcddddd
  • pqrrrrrrrrrrrrr

and code is

builder.ListFormat.ApplyBulletDefault()
For Each DataRow In table.Rows
    builder.Writeln(DataRow(7).ToString)
Next
builder.ListFormat.List = Nothing

please help me urgent

Hi

Please attach sample document produced by this code. I will check it and provide you more information.
Best regards.

Hello please the attached document … I am licence user dear please help me urgent

why the bullet not come proper manner

'Insert a line out here
line = getLine(doc, builder)
builder.InsertNode(line)
builder.InsertBreak(BreakType.LineBreak)
builder.InsertBreak(BreakType.LineBreak)

getNormal(builder)
builder.InsertBreak(BreakType.ParagraphBreak)
Dim table As DataTable table = dtPests
builder.ListFormat.ApplyBulletDefault()

For Each DataRow In table.Rows
    builder.Writeln(DataRow(7).ToString)
Next

builder.ListFormat.List = Nothing

and code is lthisssss

Thank you for additional information. Actually, I suppose, the problem is somewhere in your code. It seems, you insert LineBreak at the begging of the paragraph and that is why bullet is displayed on one line and text on another line. See the attached screenshot.
Try using ParagraphBreak instead of LineBreak.

Hope this helps.

**Hey Dear Friend Alexey Noskov

Thanks You So Much !!! For you Time to Time Response**

I m geting my mistake before you post me reply. I am inserting line break, i just change the code insert paragraph break it will works fine dear now

Rahul Mahajan