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