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

Multi-Hierarchy Radgrid Data Export

1 Answer 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 11 Jan 2013, 03:30 AM
Hello,

I have a 3-tier hierarchy grid that, currently, displays great.  However, I run into problems when I start trying to export the data to PDF/Export.  Because it'd be a ton of code if I tried to post everything, I'll do my best using pseudocode.  Currently, my report hierarchy goes like this:

<radgrid1>
   <mastertableview>
      <detailtables>
         <gridtableview>
            <nestedviewtemplate>
               <radgrid2></radgrid2>
               <radgrid3></radgrid3>
               <radlistview></radlistview>
            </nestedviewtemplate>
         </gridtableview>
         <columns>
         ...
         ...
         ...
         </columns>
      </detailtables>
   </mastertableview>
   <columns>
   ...
   ...
   ...
   </columns>
</radgrid1>


Let's say radgrid1 holds customer names, and its one detail table holds product names, so that all the information in nestedviewtemplate holds production descriptions and such.

With the exception of of radgrid1, everything is databinded via the needdatasource event.  When i go to export to excel, my code looks something like this:

radgrid1.ExportSettings.OpenInNewWindow = true;
radgrid1.ExportSettings.ExportOnlyData = true;
foreach (GridDataItem i in radgrid1.MasterTableView.Items)
{
     i.expanded = true;
     foreach (GridDataItem j in i.ChildItem.NestedTableViews[0].Items)
          j.expanded = true;
}
radgrid1.MasterTableView.ExportToPdf();

The resulting PDF/Excel has all of the data from RadGrid1 and its child table exported, but nothing from the nestedviewtemplate.  Essentially, all I am getting is a list of Customer Names and Product names under them in my report, with no product description data.

Any advice would be great.

Thank you,

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 15 Jan 2013, 10:45 PM
Hello Bob,

I suggest that you examine the project attached in the last post of the below forum thread and see if it helps to achieve your goal:
http://www.telerik.com/community/forums/aspnet-ajax/grid/itemcommand-event-is-not-firing.aspx

Regards,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or