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

exporttopdf issue

1 Answer 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
newbie
Top achievements
Rank 1
newbie asked on 18 Mar 2009, 08:06 PM
I have an ajaxified grid.
Inside the nestedtemplateview of the main grid I have another grid.
I want to give the export to pdf functionality on both of the grids.

I got the export working on the main grid and sub grid.
However, there's some data that I am not able to see.

Inside my gridtemplatecolumn for the both the grids, I have  linkbuttons and one of the fields is bound to that.
# When i set "ExportOnlyData" on the main grid to false then I am able to export that data as well. I changed the format for export as shown in :http://www.telerik.com/help/aspnet-ajax/grdexporttipstricks.html
The font size changes do not apply to the data I have in my link buttons though?
How can I do that?

# the second issue I am having is if I set ExportOnlydata on my grid to false then when the pdf is generated i am unable to open it.
It gives me error: 'Adobe reader could not open 'RadGridExport.pdf' because it is either not a supported file type or because the file has been damaged'
I am unable to figure out why i get this error on my sub grid when i set exportonlydata to false. If it is true then everything works fine.

Please suggest.


1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 23 Mar 2009, 04:34 PM
Hello Anumeha,

Straight to your questions:

1) Try the following code:
<telerik:GridTemplateColumn UniqueName="LinkCol"
    <ItemTemplate> 
        <asp:HyperLink ID="HyperLink1" runat="server" Text="LINK" NavigateUrl="~/myImage.png" /> 
    </ItemTemplate> 
</telerik:GridTemplateColumn> 

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    if (e.Item is GridDataItem && isPdfExport) 
    { 
        HyperLink hlink = e.Item.FindControl("HyperLink1"as HyperLink; 
        hlink.Style["font-size"] = "30px"
    } 

2) I will gladly provide to-the-point answer to this question if you can attach a simplified version of your project which illustrates this error.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
newbie
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or