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

[Solved] Header is not getting exported in PDF

1 Answer 256 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vivek
Top achievements
Rank 2
Vivek asked on 16 May 2013, 05:38 PM
Hi,

I'm trying to export the rad grid information in pdf file but while exporting to pdf, my header data is not getting exported, not sure why it's happening or missing some settings, please let me know how can i export rad grid data to pdf file with headers.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 May 2013, 04:06 AM
Hi Vivek,

I have tried the following code to export radgrid in PDF and it worked as expected on my end.
ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowSorting="True"Width="745px" AllowPaging="True"  AutoGenerateColumns="False" CellSpacing="0" AutoGenerateEditColumn="true" DataSourceID="SqlDataSource1">
 <ExportSettings IgnorePaging="true" OpenInNewWindow="true">
 <Pdf PageHeight="210mm" PageWidth="297mm" PageTitle="SushiBar menu" DefaultFontFamily="Arial Unicode MS"
 PageBottomMargin="20mm" PageTopMargin="20mm" PageLeftMargin="20mm" PageRightMargin="20mm" />
</ExportSettings>
<MasterTableView CommandItemDisplay="Top" DataSourceID="SqlDataSource1" PageSize="4" EditMode="PopUp">
 <PagerStyle Mode="NumericPages" />
 <CommandItemTemplate>
 <asp:Button ID="DownloadPDF" runat="server" Width="100%" CommandName="ExportToPdf" />
</CommandItemTemplate>
<Columns>
 <telerik:GridBoundColumn DataField="OrderID" DataType="System.Int32" SortExpression="OrderID" UniqueName="OrderID" HeaderText="OrderID" FilterControlAltText="Filter OrderID column">
 </telerik:GridBoundColumn>
 <telerik:GridBoundColumn DataField="ProductID" HeaderText="ProductID" SortExpression="ProductID"
UniqueName="ProductID" DataType="System.Int32" FilterControlAltText="Filter ProductID column">
</telerik:GridBoundColumn>
        ... ... ...     
</Columns>
</MasterTableView>
<HeaderStyle HorizontalAlign="Center" Font-Size="16px" />
<ItemStyle HorizontalAlign="Center" Font-Names="Arial Unicode MS" Font-Size="16px"  ForeColor="#eeeeee" />
<AlternatingItemStyle HorizontalAlign="Center" Font-Names="Arial Unicode MS" Font-Size="16px"
                ForeColor="#eeeeee" />
</telerik:RadGrid>

Please have a look into this document as well.

Thanks,
Princy.
Tags
General Discussions
Asked by
Vivek
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or