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

How to export to excel with hyper link

3 Answers 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Russell
Top achievements
Rank 1
Russell asked on 28 Aug 2017, 08:52 AM

Hi,

I used this follow function to export my grid to Excel format, while my data source(a store procedure) has hyperlink inside.

How can I just export the grid without hyperlink by setting some configurations?

aspx file

<asp:GridView ID="ExcelGridView" runat="server" BorderStyle="None"  GridLines="Both" Visible="False"  HeaderStyle-Font-Bold="true" HeaderStyle-BackColor="LightGray" OnRowDataBound="ExcelGridView_RowDataBound"></asp:GridView>

 

 

cs file

System.Data.DataTable data_table = ADOHelper.GetDataTable(ConfigurationManager.ConnectionStrings["Ligx_4_DB"].ConnectionString, query, null);
ExcelGridView.DataSource = data_table;
ExcelGridView.DataBind();
ExcelGridView.Visible = true;
Response.ClearContent();
string attachment = "attachment; filename=ExcelDownload.xls";
Response.AddHeader("Content-disposition", attachment);
Response.ContentType = "xls";

 

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 31 Aug 2017, 10:49 AM
Hello Russell,

I've already replied to your query in the formal support ticket. I suggest that we continue our technical conversation on the mentioned thread.

Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
jose
Top achievements
Rank 1
Iron
answered on 19 Nov 2021, 03:26 PM

Hi Rusell

You solve this issue and how?

 

Regards!

0
Attila Antal
Telerik team
answered on 24 Nov 2021, 01:25 PM

Hi Jose,

To export the HTML content to excel, you can use the Excel-Format="Html". This can export the complete Grid structure into a prior 2007 version of the Excel (XLS) file.

If you want to do the same but for version 2007 and later (XLSX), you will need to set the Excel Format to "Xlsx" and implement a solution that uses additional libraries such as the Telerik Document Processing Libraries (DPL).

Here is a Knowledge Base article with an example: Export to Excel XLSX with Hyperlinks

Regards,
Attila Antal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Russell
Top achievements
Rank 1
Answers by
Eyup
Telerik team
jose
Top achievements
Rank 1
Iron
Attila Antal
Telerik team
Share this question
or