Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Exporting an MSHFlexGrid Table to a Word Document

Can anyone tell me whether it is possible to export or copy a datagrid to a word document? If so, please tell how to do this.
Thanks,
Dogra.
[153 byte] By [Dogra] at [2007-11-11 7:55:42]
# 1 Re: Exporting an MSHFlexGrid Table to a Word Document
Anything's possible. ;-) You can write code to create a table in your Word document, then copy the values from the FlexGrid into the table cells. This should get you started: http://support.microsoft.com/?kbid=261999
Phil Weber at 2007-11-11 17:26:20 >
# 2 Re: Exporting an MSHFlexGrid Table to a Word Document
Phil,
The link given by you gives the output in a nice and neat report form. Thanks.

I'll try your suggestion about creating a table in the word document and then copying data into it. Meanwhile, what I see as the problem of the table-type report created by the code in the above link is that the format has to be created in the word document and then the data is added to that format. Which means double work. If one could just lift the table one has created in the grid and then copy it on to a table, the way for instance you lift a table from a webpage and insert it in a word-document, you would get the exact formatting that you had spent your time working on while preparing the grid. In short what I am looking for is a copy and paste command. It works to the extent that it takes the data to the word document, but I am not able to carry the format along with the data.

In case you come across a code that can copy and paste the format along with the data, I shall be grateful if you pass it on to me. All the same, I am grateful for your help and shall take the liberty of troubling you in future.

Thanks.
Dogra.
Dogra at 2007-11-11 17:27:20 >