Hyperlink, viewer and rpx

Posted by: cristianrosa on 4 August 2017, 2:39 pm EST

  • Posted 4 August 2017, 2:39 pm EST

    I have several reports with hyperlink to emulate drilldown reports. I use the viewer to show them. Because of the event hyperlink not fired in report I wrote down a Public sub on each report so a can call them from the Hyperlink event in the viewer that way:

    Private Sub rptView_hyperLink(ByVal Button As Integer, Link As String)
        On Error Resume Next
        Call Me.rptView.ReportSource.Myhyperlink(Button, Link)
    End Sub

    I donĀ“t know if this is the best way to workaround this, I'm afraid not but it's works for all my "inside application" reports.

    Now, I want to give same functionallity to my rpx reports. The problem is the OnHyperlink script event isn't fired inside the viewer.
    Is there a way to solve this issue?

  • Replied 4 August 2017, 2:39 pm EST

    I found a way. I post it here because it may help somebody else.

    I changed a little my viewer code posted before the way it look like this:

    Private Sub rptView_hyperLink(ByVal Button As Integer, Link As String)
        Dim Script As String
        Dim sc As ScriptControl
       
        On Error Resume Next
        Call Me.rptView.ReportSource.hyperlink_Click(Button, Link)

        Script = Me.rptView.ReportSource.Script
        If InStr(1, Script, "OnHyperlink") <> 0 Then
            Set sc = New ScriptControl
            sc.Language = "VBScript"
            sc.AddCode Script
            sc.Run "OnHyperlink", Button, Link

            Set sc = Nothing
        End If
    End Sub

    The only I need to do now is write the apropiate code in the OnHyperlink event of my rpxs and they will work the same way with the viewer or without the viewer just like my compiled reports.


Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels