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

exporting the radGrid to Excel and word

2 Answers 81 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anjali
Top achievements
Rank 1
Anjali asked on 16 Jun 2011, 10:49 PM
Hello All,

  I have a grid. I have several small grids inside the grid. I want to export the grid to MS word using RadGrid1.MasterTableView.ExportToWord();
This works fine, but when I do   RadGrid1.ExportSettings.IgnorePaging = true; then the small grids inside the bigger grid starts throwing error. I get the error message that small grid is null. I am doing the find of the small grid in
RadGrid1_ItemDataBound. below is my code

protected void RadGrid1_itemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        RadGrid RadGrid_DetailsHeader = (RadGrid)e.Item.FindControl("RadGrid_DetailsHeader");
        RadGrid_DetailsHeaderBind(casRepHeader, RadGrid_DetailsHeader);
    }
     
}
In the above code RadGrid_detailsHeader is my small grid inside RadGrid1. when I write the ignorePaging command, this radGrid_detailsHeader becomes null. I am not sure what am I doing wrong. I need to print this grid with paging. I have five grids inside the big grid.

I spend my whole day trying to work this out, but without success. I am willing to use Telerik reporting option or any other way is also fine.

I have to export this grid to MS word and Excel.

I really really need help with this one.

Any help or tips will be greatly appreciated.

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 22 Jun 2011, 09:17 PM
Hello Anjali,

You can export all pages even if IgnorePaging is set to false. For that purpose you have to set AllowPaging to false before exporting. Note that for this change to take effect you will have to invoke RadGrid.Rebind afterwards.
RadGrid1.AllowPaging = false;
RadGrid1.Rebind();


Best regards,
Daniel
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Anjali
Top achievements
Rank 1
answered on 23 Jun 2011, 03:56 PM
Thanks Daniel
Tags
Grid
Asked by
Anjali
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Anjali
Top achievements
Rank 1
Share this question
or