Создание отчета Crystal с выбранной строкой в ​​GridView - PullRequest
0 голосов
/ 22 марта 2019

У меня есть GridView, который я назвал "gvPersonnelEquipment". У меня есть LinkButton под названием «Создать отчет», расположенный над GridView. Теперь я пытаюсь сделать следующее: когда я щелкаю элемент в моем GridView, я хочу отобразить эту строку в отчете Crystal Report. С моим кодом прямо сейчас я могу отображать только первый элемент в моем GridView. Создать другой RowCommand для этого? Вот что у меня есть:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Dim cryRpt As New ReportDocument
    Dim crtableLogoninfos As New TableLogOnInfos
    Dim crtableLogoninfo As New TableLogOnInfo
    Dim crConnectionInfo As New ConnectionInfo
    Dim CrTables As Tables
    Dim CrTable As Table

    cryRpt.Load(Server.MapPath("PersonnelListingReport.rpt"))

    With crConnectionInfo
        .ServerName = "0.0.0.0"
        .DatabaseName = "testDB"
        .UserID = "test"
        .Password = "test"
    End With

    CrTables = cryRpt.Database.Tables
    For Each CrTable In CrTables
        crtableLogoninfo = CrTable.LogOnInfo
        crtableLogoninfo.ConnectionInfo = crConnectionInfo
        CrTable.ApplyLogOnInfo(crtableLogoninfo)
    Next

    CrystalReportViewer1.ReportSource = cryRpt
    CrystalReportViewer1.RefreshReport()


End Sub

Конечный класс

...