Hi,
I have a three tier hierarchical grid with sqldatasource.I wanna export all of the data in the grid.I've looked the example given in this link.
I added <CommandItemSettings ShowExportToExcelButton="true" ShowExportToWordButton="true"
ShowExportToPdfButton="true" /> and <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
<Excel Format="Html" />
</ExportSettings> in my aspx page,but I can't make it.
How I can export the data to pdf?
I have a three tier hierarchical grid with sqldatasource.I wanna export all of the data in the grid.I've looked the example given in this link.
I added <CommandItemSettings ShowExportToExcelButton="true" ShowExportToWordButton="true"
ShowExportToPdfButton="true" /> and <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
<Excel Format="Html" />
</ExportSettings> in my aspx page,but I can't make it.
How I can export the data to pdf?
5 Answers, 1 is accepted
0

Jayesh Goyani
Top achievements
Rank 2
answered on 15 Dec 2011, 11:36 AM
Hello,
PLease look in below code snippet.
Thanks,
Jayesh Goyani
PLease look in below code snippet.
protected
void
ExportActivity(
bool
IsExpandable)
{
radgrdExtraActivityList.ExportSettings.IgnorePaging =
true
;
radgrdExtraActivityList.ExportSettings.HideStructureColumns =
true
;
radgrdExtraActivityList.ExportSettings.ExportOnlyData =
true
;
radgrdExtraActivityList.ExportSettings.OpenInNewWindow =
true
;
if
(IsExpandable)
{
radgrdExtraActivityList.MasterTableView.HierarchyDefaultExpanded =
true
;
radgrdExtraActivityList.Rebind();
}
else
radgrdExtraActivityList.MasterTableView.HierarchyDefaultExpanded =
false
;
}
radgrdExtraActivityList.MasterTableView.ExportToPdf();
}
Thanks,
Jayesh Goyani
0

Emre
Top achievements
Rank 1
answered on 15 Dec 2011, 05:09 PM
hi,jayesh
where should I add this code to?I mean ExportActivity function.
where should I add this code to?I mean ExportActivity function.
0

Jayesh Goyani
Top achievements
Rank 2
answered on 16 Dec 2011, 06:12 AM
Hello,
Thanks,
Jayesh Goyani
if
(e.CommandName == RadGrid.ExportToPdfCommandName)
{
RadGrid1.MasterTableView.HierarchyDefaultExpanded =
true
;
//RadGrid1.Rebind();
}
Thanks,
Jayesh Goyani
0

Emre
Top achievements
Rank 1
answered on 16 Dec 2011, 09:17 AM
Jayesh,
I put your code in the item command event of the grid ,but it didn't convert the grid into pdf,just expands the master table.
I put your code in the item command event of the grid ,but it didn't convert the grid into pdf,just expands the master table.
0

Jayesh Goyani
Top achievements
Rank 2
answered on 16 Dec 2011, 11:40 AM