Sno Elector's Name Father'sName House No Age Sex Id
1 RAGHAVENDHAR LAXMANACHARI 1-1-*400/401 36 Male ZTS1298603
2 BHARATHA LAKSHMIARIGILA SAIKUMAR A 1-1-1 41 Female ZTS1083807
3 HMA BINDU SENAGASETI KRISHNA RAO S 1-1-1 37 Female ZTS1083815
4
5
6
7
.........i have more then 2000 rows .....
i would like display sql table date to MS word or pdf like below formate
plz help me...........
.
Megan FosterPosted Feb 9, 2015, 4:55 AM
You first need to define a template file with the required layout and placeholders (in which you want to import the data later on).
Actually you don't have to create a template file, but creating a Word document from scratch in C# with the required layout and placeholders is a bit of an unnecessary hassle.
So for example here is a template file:
The template has the desired layout of the single record and has placeholders which names correspond to the DataTable's columns name. Also the area is wrapped around the range definition ("TableData").
Now you need to read the template Word document with C#:
After that you can execute the mail merge process on your Word file with C#:
And save the result into a file:
Note that you can create a PDF file in same C# manner, you just need to replace the output file's extension from ".docx" to ".pdf".