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

Expor to Excel Ajax

5 Answers 57 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
SANNIDHI
Top achievements
Rank 1
SANNIDHI asked on 27 Dec 2011, 11:29 AM
Hi,

       I want to export radgrid to excel..
     
      In that i have one column with hyperlink and i want to that hyperlink with href should be present in Excel also..

      Please give me Reply ASAp.

Thanks,
SANNIDHI

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 27 Dec 2011, 01:53 PM
Hello,

Try the following.
ASPX:
<telerik:RadGrid ID="grid1" runat="server" CellSpacing="0" DataSourceID="SqlDataSource1" AllowPaging="true" OnItemCreated="grid1_ItemCreated" OnExcelExportCellFormatting="grid1_ExcelExportCellFormatting">
  <ExportSettings IgnorePaging="true" OpenInNewWindow="true">
  </ExportSettings>
    <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" DataKeyNames="EmployeeID">
       <CommandItemSettings ShowExportToPdfButton="true" />
       <Columns>
                    .... ... ...
           <telerik:GridHyperLinkColumn DataTextFormatString="Search Google for '{0}'" DataNavigateUrlFields="FirstName" UniqueName="FirstName" DataNavigateUrlFormatString="http://www.google.com/search?hl=en&q={0} btnG=Google+Search" DataTextField="FirstName">
          </telerik:GridHyperLinkColumn>
     </Columns>
   </MasterTableView>
</telerik:RadGrid>

Thanks,
Princy.
0
SANNIDHI
Top achievements
Rank 1
answered on 28 Dec 2011, 04:59 AM
Hi,


          I tried this..hyeprlink is working fine in grid..
  
            when grid is exported to excel..hyeprlink is not working..means it is not showing any link for the respective text.


Thanks,
PANDU
0
SANNIDHI
Top achievements
Rank 1
answered on 28 Dec 2011, 05:32 AM
I am using

 

<ExportSettings FileName="SearchResult" Excel-Format="ExcelML" HideStructureColumns="false" ></ExportSettings>

.

Please tell me the solution....


i dont want to use html format...just excelML

cellelement.href is also not working for meeeee
0
Princy
Top achievements
Rank 2
answered on 28 Dec 2011, 07:41 AM
Hello,

I have tried the same code I have given in the above post and it shows link for respective text. I am using the version 2011, 2, 915, 35. Here is the screenshot.

Thanks,
Princy.
0
Andrey
Telerik team
answered on 28 Dec 2011, 03:55 PM
Hello Sannidhi,

RadGrid will export only the text specified in the DataTextFormatString property. So if you want to get some information in the exported file you should make sure to include it in this property.

Other than that the approach that Princy showed should work for you. Give this approach a try and check whether this is the desired behavior.


All the best,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Ajax
Asked by
SANNIDHI
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
SANNIDHI
Top achievements
Rank 1
Andrey
Telerik team
Share this question
or