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

Export to PDF Datagrid Problem

6 Answers 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Het
Top achievements
Rank 1
Het asked on 08 Aug 2008, 02:36 PM
Telerik Support,

I am refering the sample to export from grid to PDF at http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/GeneralFeatures/PdfExport/DefaultCS.aspx

But its not working for me as desired. Below is my code, when I click on the PDF, data is not exported to pdf and the PDF button disappears. 

<

telerik:RadGrid ID="gd" runat="server" AllowPaging="True" AllowSorting="True" GridLines="None"

Skin="Office2007" AutoGenerateColumns="False" OnItemDataBound="gd_ItemDataBound"

Height="100%" Width="100%" PageSize="5" AllowMultiRowSelection="true">

<ExportSettings IgnorePaging="false" OpenInNewWindow="true" ExportOnlyData="true">

<Pdf AllowAdd="false" AllowCopy="true" AllowModify="true" AllowPrinting="true" Author="Anonymous"

Keywords="None" PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in"

PageTopMargin="1in" PageTitle="Status Result Export" Subject="Status Result Export"

Title="Status Result export" PaperSize="Letter" />

</ExportSettings>

<%

--<PagerStyle Mode="NextPrevAndNumeric" Position="Bottom" NextPageText="Next" PrevPageText="Prev" />--%>

<ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"

Font-Underline="False" VerticalAlign="Top" Wrap="True" Height="100%" Width="100%" />

<MasterTableView Height="100%">

<RowIndicatorColumn Visible="False">

<HeaderStyle Width="20px" />

</RowIndicatorColumn>

<ExpandCollapseColumn Resizable="False" Visible="False">

<HeaderStyle Width="20px" />

</ExpandCollapseColumn>

<PagerTemplate>

<div style="display:'block'">

<asp:ImageButton ID="ExportToPDF" Style="cursor: pointer;" ImageUrl="~/App_Themes/Pdf.png"

AlternateText="Export to PDF" CommandName="ExportToPdf" runat="server"></asp:ImageButton>

</div>

</PagerTemplate>

<Columns>

<

telerik:GridTemplateColumn HeaderText="Item #" ItemStyle-Width="10%" ItemStyle-VerticalAlign="Top">

<ItemTemplate>

<asp:Label ID="lblItemNbr" runat="server"></asp:Label>

<asp:TextBox ID="txtEnrtaskId" CssClass="HideLabel" runat="server" Width="0px" Height="0px"></asp:TextBox>

</ItemTemplate>

<ItemStyle VerticalAlign="Top" Width="10%"></ItemStyle>

</telerik:GridTemplateColumn>

</

Columns>

<EditFormSettings>

<PopUpSettings ScrollBars="None" />

</EditFormSettings>

</MasterTableView>

<ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" AllowKeyboardNavigation="true">

<ClientEvents OnRowContextMenu="gdRowContextMenu" />

<Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />

<Scrolling AllowScroll="False" UseStaticHeaders="False" />

<Resizing AllowColumnResize="True" ResizeGridOnColumnResize="True" EnableRealTimeResize="True">

</Resizing>

</ClientSettings>

</telerik:RadGrid>

Could you please advice if I am missing anything here ?

6 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 11 Aug 2008, 08:00 AM
Hello Het,

I'm unable to reproduce the mentioned behavior and thus I attached an example based on your code. Please modify the provided website in order to be able to replicate it.

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Het
Top achievements
Rank 1
answered on 18 Aug 2008, 01:32 PM
Its still not working in my case.
0
Daniel
Telerik team
answered on 19 Aug 2008, 10:58 AM
Hello Het,

We need you cooperation in order to bring the attached project to that state you claim to be causing the mentioned issue. Please note that the project is based on the code you provided.

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Het
Top achievements
Rank 1
answered on 20 Aug 2008, 03:39 PM
Daniel,

I modified my program as per code given by you. But its not giving any error as well as its not opening any new window to show the exported data.

I just replicated you code.

Is it that Export doesn't work with GridTemplateColumns ?

Thanks,
Het
0
Daniel
Telerik team
answered on 25 Aug 2008, 11:11 AM
Hello Het,

Based on the code I attached I believe that you should not experience any problems while exporting to PDF from template column using the latest version (Q2 2008). I tested this behavior on several machines and I confirm that it is working properly. I attached some screenshots illustrating the behavior to this post.

Could you please check your RadControls for ASP.NET AJAX version?

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Het
Top achievements
Rank 1
answered on 25 Aug 2008, 08:29 PM
Thanks Daniel for your response.

I will try with the Q2 release and check.

Thanks,
Het
Tags
Grid
Asked by
Het
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Het
Top achievements
Rank 1
Share this question
or