Imports GrapeCity.ActiveReports 
Imports GrapeCity.ActiveReports.Document

Public Class subRptAufschubdaten
    Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
    Dim AbfKostKdnr As Integer
    'Dim ABF_ART As Integer
    Sub New(AbfKostKdnr As Integer)

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

    Private Sub Detail_Format(sender As Object, e As EventArgs) Handles Detail.Format
        Try
            If Me.DataSource IsNot Nothing AndAlso DirectCast(Me.DataSource, DataTable).Rows.Count > 0 AndAlso Me.Fields IsNot Nothing Then
                If Me.Fields.Item("kdAkto_art") IsNot Nothing AndAlso Me.Fields.Item("kdAkto_art").Value IsNot Nothing Then
                    Select Case Me.Fields.Item("kdAkto_art").Value.ToString
                        Case "10" : txtLeistungsNr.Text = "10 - ZOLL & EUST"
                        Case "15" : txtLeistungsNr.Text = "15 - ZOLL"
                        Case "20" : txtLeistungsNr.Text = "20 - EUST"
                    End Select
                End If
                If Me.Fields.Item("Konto") IsNot Nothing AndAlso Me.Fields.Item("Konto").Value IsNot Nothing Then txtLeistungsBez.Text = Me.Fields.Item("Konto").Value.ToString
                If Me.Fields.Item("EORI") IsNot Nothing AndAlso Me.Fields.Item("EORI").Value IsNot DBNull.Value Then txtGeaendertAm.Text = (Me.Fields.Item("EORI").Value).ToString
            End If
        Catch ex As Exception
            MsgBox(ex.Message & ex.StackTrace)
        End Try

    End Sub
    Private Sub rptAuswertung_ReportStart(sender As System.Object, e As System.EventArgs) Handles MyBase.ReportStart
        If AbfKostKdnr <= 0 Then Exit Sub

        Me.DataSource = SQL.loadDgvBySql("SELECT [kdAkto_art],[kdAkto_hauptzollamt] + ' - ' + [kdAkto_kontonummer]  as Konto,[kdAkto_eori] + [kdAkto_eoriNL] as EORI  FROM [tblKundenAufschubkonten]  where kdAkto_KundenNr='" & AbfKostKdnr & "' order by [kdAkto_art] ", "FMZOLL")

        '  Me.GroupHeader1.DataField = "OffertenNr" 'Gruppierung

    End Sub

    'Private Sub GroupHeader1_Format(sender As Object, e As EventArgs) Handles GroupHeader1.Format
    '    'Dim OffertenNr = Me.Fields.Item("OffertenNr").Value
    '    'If OffertenNr IsNot Nothing Then
    '    '    lbl1Zollabfertigung.Text = OffertenNr & " - " & SQL.getValueTxtBySql("SELECT [OffertenBez]  FROM [Offertenstamm] WHERE OffertenNr=" & OffertenNr, "FMZOLL")
    '    'End If
    'End Sub
End Class

