This is a migrated thread and some comments may be shown as answers.

Insert RadGrid in a Word (Template) Document

1 Answer 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Karan
Top achievements
Rank 1
Karan asked on 07 Jan 2013, 07:05 AM
Hi,

I have a word document, It is a template file with mail merge fields that need to be replaced by RadGrid control.

Having searched your forums, I believe it is not possible to insert a rad grid control into an existing word file.

Can you please guide me how can I achieve this. The only way I see it is getting the HTML out from RadGrid and then inserting that HTML into the word document.  Can you please link me to an example where it shows how can I convert or extract the HTML from a RadGrid. Also what happens if the data in the grid is grouped ? and is it possible to turn of paging before getting the html ?

Thanks
Kam

1 Answer, 1 is accepted

Sort by
0
Kaushal
Top achievements
Rank 2
answered on 07 Jan 2013, 11:46 AM
Hi Karan,

Follow the steps bellow to achieve your requirement 
Step1:
IF you set the  <ExportSettings ExportOnlyData="false"  Excel-Format="Html" /> will give you a html and if you just want data set ExportOnlyData="true"

Step2:
On Export Button Click paste

 RadgridID.ExportSettings.FileName ="File Name"
 RadgridID.MasterTableView.GetItems(GridItemType.Pager)[0].Visible = false; // Hide the pager (set Visible false for the item you dont want)
RadgridID.ExportSettings.IgnorePaging =true;
RadgridID.MasterTableView.ExportToWord();


Tags
Grid
Asked by
Karan
Top achievements
Rank 1
Answers by
Kaushal
Top achievements
Rank 2
Share this question
or