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

LinkButtton not displaying in export to PDF

1 Answer 153 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dhamodharan
Top achievements
Rank 1
Dhamodharan asked on 20 Dec 2010, 08:21 AM
Hi,

I have using Radgrid Export to PDF option. i have four columns in my radgrid. i am using linkbutton in my grid. but all record download but linkbutton column not showing in PDF. i am using in aspx page in this code.

<ExportSettings ExportOnlyData="true" IgnorePaging="True" OpenInNewWindow="true" >
                                <Pdf FontType="Subset" PaperSize="Letter" PageTitle="Employee Password List"  />
                                <Excel Format="Html"  />
                                <Csv RowDelimiter="NewLine" FileExtension="Csv"/>
                            </ExportSettings>
                            <PagerStyle Mode="NextPrevNumericAndAdvanced" />

and vb page

If e.ExportType = ExportType.Pdf Then
            dgPortalUsers.ExportSettings.IgnorePaging = True
            dgPortalUsers.ExportSettings.OpenInNewWindow = True
            dgPortalUsers.ExportSettings.ExportOnlyData = True
            e.ExportOutput = Replace(e.ExportType, "<br/>", "")
        End If

I have three doubts in this page

1. How to display linkbutton(Text) in PDF and Excel
2. How to hide Filter option what we enter some text.
3. How to restrict particular row in this grid. like name=John means we need to download without this row.


I have attached images also. Please check and help me ASAP.

Thanks in Advance,
Dhamu.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 20 Dec 2010, 12:11 PM
Hello Dhamodharan,

You need to set ExportOnlyData as 'False' to show LinkButton in Excel/Pdf.
VB.NET:
Protected Sub RadGrid1_ItemCommand(sender As Object, e As GridCommandEventArgs)
    If e.CommandName = RadGrid.ExportToPdfCommandName Then
        RadGrid1.ExportSettings.IgnorePaging = True
        RadGrid1.ExportSettings.OpenInNewWindow = True
        RadGrid1.ExportSettings.ExportOnlyData = False
    End If
End Sub

The following code snippet shows how to clear filter TextBox when exporting.

VB.NET:
Protected Sub RadGrid1_ItemCommand(sender As Object, e As GridCommandEventArgs)
    If e.CommandName = RadGrid.ExportToExcelCommandName Then
        RadGrid1.ExportSettings.ExportOnlyData = False
        For Each column As GridColumn In RadGrid1.MasterTableView.Columns
            column.CurrentFilterFunction = GridKnownFunction.NoFilter
            column.CurrentFilterValue = String.Empty
        Next
    End If
End Sub

And for you third requirement, please go through the 'Hiding Items' part of following documentations.
PDF export
Word/Excel export (HTML-based)

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