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

[Solved] ExportToPdf with Header and Footer

1 Answer 151 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 09 Dec 2009, 07:13 AM
Alex

I want to export the RadGrid data to pdf. I can successfully export to pdf but i want to add cutomize header, footer and logo.

is there any way to achieve this requirement?

Alex

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 09 Dec 2009, 11:18 AM
Hello Alex,

A suggestion would be to make use of the CommandItemTemplate and the PagerItemTemplate to export additional details to pdf. Here's an example
aspx:
<telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" AllowPaging="true" AutoGenerateColumns="true" runat="server">              
    <MasterTableView DataSourceID="SqlDataSource1">    
         <CommandItemTemplate> 
             Header Information <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/Logo1.gif" /> 
         </CommandItemTemplate>      
         <PagerTemplate> 
              Footer Information <asp:Image ID="Image2" runat="server" ImageUrl="~/Images/LOgo2.gif" /> 
         </PagerTemplate> 
              ........ 

c#:
protected void btnExport_Click(object sender, EventArgs e) 
    {               
        RadGrid1.ExportSettings.ExportOnlyData = false;                 
        RadGrid1.ExportSettings.OpenInNewWindow = true
        RadGrid1.MasterTableView.ExportToPdf(); 
    } 

Thanks
Princy.
Tags
Grid
Asked by
Alex
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or