question

markgoldin-3750 avatar image
0 Votes"
markgoldin-3750 asked IsabellaZhangMSFT-7746 commented

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

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

IsabellaZhangMSFT-7746 avatar image
0 Votes"
IsabellaZhangMSFT-7746 answered IsabellaZhangMSFT-7746 edited

Hi @markgoldin-3750,

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.




test.png (36.2 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Your code in the report doesn't look like a bullet list. Did you set it as HTML?

0 Votes 0 ·

Hi @markgoldin-3750
After I set it as HTML ,I got this,is it what you expect ?
138034-test1.png


0 Votes 0 ·
test1.png (27.5 KiB)
markgoldin-3750 avatar image markgoldin-3750 IsabellaZhangMSFT-7746 ·

Yes. Now export it into Excel. Move the mouse over 10643 and 10692. see if you get different tooltips. If yes, please provide your RDL.

0 Votes 0 ·
Show more comments
IsabellaZhangMSFT-7746 avatar image
0 Votes"
IsabellaZhangMSFT-7746 answered IsabellaZhangMSFT-7746 commented

Hi @markgoldin-3750

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.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes, seems like another bug.

0 Votes 0 ·

I might think that ,it is not bug,the excel designed like that originally .

0 Votes 0 ·