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

mark goldin 691 Reputation points
2021-10-05T14:45:53.733+00:00

0

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()  
builder.Append("<ul>")  

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

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?

Thanks

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,816 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Isabellaz-1451 3,616 Reputation points
    2021-10-06T03:30:39.837+00:00

    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.

    137914-test.png
    Best Regards,
    Isabella


    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
    2021-10-07T06:34:37.48+00:00

    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
    2022-07-05T23:03:30.317+00:00

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

    0 comments No comments