We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

add hyperlinks to cell

Thread ID:

Created:

Updated:

Platform:

Replies:

101617 Nov 8,2011 09:38 AM Nov 14,2011 01:45 AM ASP.NET Web Forms (Classic) 3
loading
Tags: XlsIO
Navin
Asked On November 8, 2011 09:38 AM

Hi,

exporting a datatable to excel sheet using ImportDataTable function and one of the column is a link.

How can i add hyperlinks to the cells after importing the data to excel?

Regards,
Navin


Navin
Replied On November 11, 2011 01:46 AM

hi,

can please an answer for my question.

thanks
navin


Administrator [Syncfusion]
Replied On November 13, 2011 08:40 PM

Hi Navin,

Sorry for the delayed reply.

Thank you for using Syncfusion product.

XlsIO provides interactive features support to convert the cell text to a hyperlink. Please follow the below code snippet for your requirement.

//Creating Hyperlink for a Website
IHyperLink hyperlink = worksheet.HyperLinks.Add(worksheet.Range["C5"]);
hyperlink.Type = ExcelHyperLinkType.Url;
hyperlink.Address = "http://www.syncfusion.com/products/xlsio/windows/default.aspx";
hyperlink.ScreenTip = "To know more About XlsIO go through this link";

//Creating Hyperlink for e-mail
IHyperLink hyperlink1 = worksheet.HyperLinks.Add(worksheet.Range["C7"]);
hyperlink1.Type = ExcelHyperLinkType.Url;
hyperlink1.Address = "mailto:support@syncfusion.com";
hyperlink1.ScreenTip = "Send Mail to this id for your queries";

//Creating Hyperlink for Opening Files using type as File
IHyperLink hyperlink2 = worksheet.HyperLinks.Add(worksheet.Range["C9"]);
hyperlink2.Type = ExcelHyperLinkType.File;

hyperlink2.Address = @"..\..\";
hyperlink2.ScreenTip = "File path";
hyperlink2.TextToDisplay = "Hyperlink for files using File as type";

//Creating Hyperlink for Opening Files using type as Unc
IHyperLink hyperlink3 = worksheet.HyperLinks.Add(worksheet.Range["C11"]);
hyperlink3.Type = ExcelHyperLinkType.Unc;
hyperlink3.Address = @"C:\Program Files\Syncfusion\Essential Studio";
hyperlink3.ScreenTip = "Click here for files";
hyperlink3.TextToDisplay = "Hyperlink for files using Unc as type";

//Creating Hyperlink to another cell using type as Workbook
IHyperLink hyperlink4 = worksheet.HyperLinks.Add(worksheet.Range["C13"]);
hyperlink4.Type = ExcelHyperLinkType.Workbook;
hyperlink4.Address = "Sheet1!B21";
hyperlink4.ScreenTip = "Click here";
hyperlink4.TextToDisplay = "Click here to move to the cell with Comments about XlsIO";

IHyperLink hyperlink5 = worksheet.HyperLinks.Add(worksheet.Range["C15"]);
hyperlink5.Type = ExcelHyperLinkType.Workbook;
hyperlink5.Address = "Sheet1!B23";
hyperlink5.ScreenTip = "Click here";
hyperlink5.TextToDisplay = "Click here to move to the cell with Comments about this sample";

//Disabling Hyperlink using type as None
IHyperLink hyperlink6 = worksheet.HyperLinks.Add(worksheet.Range["C17"]);
hyperlink6.Type = ExcelHyperLinkType.None;
hyperlink6.ScreenTip = "Use this Address";
hyperlink6.TextToDisplay = "www.syncfusion.com";

Note: You can find the sample program in the Syncfusion Dashboard which you have installed.

Please let me know if there is any clarification.

Regards,

Johnson



Hi Navin_98c707bc.zip

Sridhar [Syncfusion]
Replied On November 14, 2011 01:45 AM

Hi Navin,

Please try the above given solution at your side and let us know if these helps you.

Please go through the following online doumentaion link for more details.

http://help.syncfusion.com/ug_94/Reporting/XlsIO/ASP.NET/default.htm?turl=Documents%2Flinks.htm

Please let me know if you require any further clarifications.

thanks,
Sridhar.S


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;