SSRS report - Bullet List with hyperlinks is not exporting properly into Excel

mark goldin 691 Reputation points


I am having a problem exporting a report into Excel. The report is using some custom code that works fine for PDF and Word, but in Excel it is not working properly. Here is the code.

Textbox expression:

=Code.MakeProjectstHyperLinks(LookupSet(Fields!PointName.Value, Fields!PointName.Value,
Fields!ProjectName.Value, "SystemPointDetails"), LookupSet(Fields!PointName.Value,
Fields!PointName.Value, Fields!ProjectId.Value, "SystemPointDetails"))
Custom code:

Function MakeProjectstHyperLinks(ByVal ProjectNames As Object(), ByVal ProjectIds As Object())
As String
If ProjectNames Is Nothing Then
Return Nothing
End If

Dim builder As System.Text.StringBuilder = New System.Text.StringBuilder()  

For number As Integer  = 0 To ProjectNames.Length - 1
  builder.append("<a href=""" & Report.Parameters!Trending_URL.Value & "?projectid=" & 
  ProjectIds(number)  & """ target=""_blank"">" & ProjectNames(number) & "</a>")

Return builder.ToString()  

End Function
What happens in Excel is that in this line:

builder.append("<a href=""" & Report.Parameters!Trending_URL.Value & "?projectid=" &
ProjectIds(number) & """ target=""_blank"">" & ProjectNames(number) & "</a>")
ProjectIds(number) always show the first element of ProjectIds although "number" is correct. Do you have any idea what might be wrong?


SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,869 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Isabellaz-1451 3,616 Reputation points

    Hi @mark goldin ,

    I made a test in my report builder 3.0,it works after I export to excel . It seems there is nothing wrong with your code.

    Best Regards,

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

  2. Isabellaz-1451 3,616 Reputation points

    Hi @mark goldin

    I think your issue is due to that in excel only one link in the box is allowed.

    I try to merge two links in two box,then there is only one link left.

  3. mw 1 Reputation point

    Has anyone tried concatenating the Chr with a String: "" & Chr(0149)

    0 comments No comments