martes, 31 de marzo de 2015

Microsoft Word Automation, let word do the numbering for you

This is a simple trick,
We use MSWord to generate some quick reports for our clients, We create a table in a word document and we fill the table with the data we retrieve from SQL Server. Sometimes we need to add a number to the each Row to show the number of records or just numbering each row, so we added ROW_NUMBER ... etc to our queries, until now, because I tried this trick.

like the picture shows bellow  we draw a 3 rows tables and in the row were the data will be populated i create a empty column and I clicked in the Numbering Icon from the Word Tool Bar, this will insert a number 1. in that empty column.

The result will be :
The report with a sequential number in each row, pretty simple and some time saver.

No hay comentarios.:

Publicar un comentario