Invalid URI: The hostname could not be parsed.
New DiscussionHello,
In the company I work for, we are using Infragistics Documents Excel module to parse a stream from the database representing an Excel file. The file contains @ signs in it, that excel considers to be mailto: hyperlink by default. When this happens, the infragistics Workbook.Load(stream) method throws an error with Invalid URI: The hostname could not be parsed. due to not being able to parse the mailto hyperlink.
Is there a way to fix or bypass this issue, it’s causing problems when large volumes of files are being processed and the support team has to go though the files and remove the hyperlinks.
I am using Infragistics4.Documents.Excel.v12.2, with .NET Framework 4.5.2 on Windows. The full error is this :
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString, UriKind uriKind)
at MS.Internal.IO.Packaging.InternalRelationshipCollection.ProcessRelationshipAttributes(XmlCompatibilityReader reader)
at MS.Internal.IO.Packaging.InternalRelationshipCollection.ParseRelationshipPart(PackagePart part)
at MS.Internal.IO.Packaging.InternalRelationshipCollection..ctor(Package package, PackagePart part)
at System.IO.Packaging.PackagePart.EnsureRelationships()
at System.IO.Packaging.PackagePart.GetRelationshipsHelper(String filterString)
at Infragistics.Documents.Excel.PackagePartWrapper.GetRelationships()
at Infragistics.Documents.Excel.Serialization.Excel2007.Excel2007WorkbookSerializationManager.LoadPart(IPackagePart part)
at Infragistics.Documents.Excel.Serialization.Excel2007.Excel2007WorkbookSerializationManager.LoadPartRelationships(IEnumerable`1 relationships, ContentTypeBase contentType, Boolean isPostLoad)
at Infragistics.Documents.Excel.Serialization.Excel2007.Excel2007WorkbookSerializationManager.LoadPart(IPackagePart part)
at Infragistics.Documents.Excel.Serialization.Excel2007.Excel2007WorkbookSerializationManager.LoadPartRelationships(IEnumerable`1 relationships, ContentTypeBase contentType, Boolean isPostLoad)
at Infragistics.Documents.Excel.Serialization.Excel2007.Excel2007WorkbookSerializationManager.LoadWorkbookContents()
at Infragistics.Documents.Excel.Serialization.WorkbookSerializationManager.Load()
at Infragistics.Documents.Excel.Workbook.LoadXLSXFile(Workbook workbook, Stream stream, IPackageFactory packageFactory, Boolean verifyExcel2007Xml)
at Infragistics.Documents.Excel.Workbook.LoadHelper(Stream stream, WorkbookFormat format, String parameterName, IPackageFactory packageFactory, Boolean verifyExcel2007Xml)
at Infragistics.Documents.Excel.Workbook.Load(Stream stream, IPackageFactory packageFactory, Boolean verifyExcel2007Xml)
at Infragistics.Documents.Excel.Workbook.Load(Stream stream, Boolean verifyExcel2007Xml)
Any help would be appreciated.
Thank you,
Radu