Imports GrapeCity.ActiveReports 
Imports GrapeCity.ActiveReports.Document

Public Class subRptBonitaetsverlauf
    Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
    Dim Kdnr As Integer

    Sub New(Kdnr As Integer)

        ' Dieser Aufruf ist für den Designer erforderlich.
        InitializeComponent()
        Me.Kdnr = Kdnr
        ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
    End Sub

    Private Sub Detail_Format(sender As Object, e As EventArgs) Handles Detail.Format
        If Me.DataSource IsNot Nothing AndAlso DirectCast(Me.DataSource, DataTable).Rows.Count > 0 AndAlso Me.Fields IsNot Nothing Then
            If Me.Fields.Item("ba_Datum") IsNot Nothing AndAlso Me.Fields.Item("ba_Datum").Value IsNot Nothing Then txtLeistungsNr.Text = CDate(Me.Fields.Item("ba_Datum").Value).ToShortDateString
            If Me.Fields.Item("ba_BonitaetsIndex") IsNot Nothing AndAlso Me.Fields.Item("ba_BonitaetsIndex").Value IsNot Nothing Then txtLeistungsBez.Text = Me.Fields.Item("ba_BonitaetsIndex").Value.ToString
        End If
    End Sub
    Private Sub rptAuswertung_ReportStart(sender As System.Object, e As System.EventArgs) Handles MyBase.ReportStart
        If Kdnr <= 0 Then Exit Sub
        Me.DataSource = SQL.loadDgvBySql("SELECT TOP 4 [ba_Datum] ,[ba_BonitaetsIndex]  FROM [VERAG].[dbo].[tblBonitaetsauskunft]    where ba_KundenNr=" & Kdnr & " order by [ba_Datum] desc", "FMZOLL")
    End Sub


End Class
