201020
This commit is contained in:
91
Aviso/Auswertung/usrctlStatVERIMEX.vb
Normal file
91
Aviso/Auswertung/usrctlStatVERIMEX.vb
Normal file
@@ -0,0 +1,91 @@
|
||||
Imports Gemeinsames
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
Public Class usrctlStatVERIMEX
|
||||
|
||||
|
||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
|
||||
Sub init()
|
||||
With dgvAbklaerungTR
|
||||
Dim sqlstr = "SELECT mit_vname + ' ' + mit_nname as Mitarbeiter ,count(*) as Sendungen ,count(distinct(avisoid)) as LKW
|
||||
FROM [tblSendungen] inner join aviso on AvisoID = tblSnd_AvisoID inner join admin.dbo.tblMitarbeiter on mit_id=tblSnd_AbklaerungTR_MA
|
||||
where cast(Datum as date) BETWEEN '" & datStatVon.Value & "' and '" & datStatBis.Value & "' and tblSnd_AbklaerungTR_MA is not null
|
||||
group by mit_vname,mit_nname"
|
||||
|
||||
dgvAbklaerungTR.DataSource = SQL.loadDgvBySql(sqlstr, "AVISO")
|
||||
|
||||
End With
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub datStatVon_ValueChanged(sender As Object, e As EventArgs) Handles datStatVon.ValueChanged, datStatBis.ValueChanged
|
||||
init()
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
SDL.cProgramFunctions.genExcelFromDGV_NEW(dgvAbklaerungTR, False)
|
||||
Me.Cursor = Cursors.Default
|
||||
End Sub
|
||||
|
||||
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
||||
|
||||
|
||||
Dim print As New frmPrintLayout
|
||||
print.Text = "Speditionsbericht"
|
||||
|
||||
Dim rpt As New rptStat_VERIMEX_AbklTR
|
||||
|
||||
rpt.DataSource = dgvAbklaerungTR.DataSource
|
||||
|
||||
|
||||
|
||||
|
||||
If rpt.DataSource Is Nothing OrElse rpt.DataSource.rows.count = 0 Then
|
||||
rpt.Dispose() : print.Dispose()
|
||||
MsgBox("Keine Daten vorhanden!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim sum = 0
|
||||
rpt.lblUeberschrift.Text = "Sendungserfassung TR " & datStatVon.Text & " bis " & datStatBis.Text
|
||||
rpt.lblSachbearbeiter.Text = VERAG_PROG_ALLGEMEIN.cAllgemein.USRNAME
|
||||
'rpt.lblMandantNiederlassung.Text = PERSONAL.Mandant & " / " & PERSONAL.Niederlassung
|
||||
|
||||
'Dim cnt As Integer = 0
|
||||
rpt.lblDat.Text = Now.ToLongDateString
|
||||
Dim sumSnd As Integer = 0
|
||||
Dim sumLKW As Integer = 0
|
||||
|
||||
|
||||
AddHandler rpt.Detail.Format, Sub()
|
||||
'rpt.lblVon.Text = CDate(rpt.Fields.Item("von").Value).ToShortDateString
|
||||
'rpt.lblBis.Text = CDate(rpt.Fields.Item("bis").Value).ToShortDateString
|
||||
rpt.lblAnzSnd.Text = rpt.Fields.Item("Sendungen").Value
|
||||
rpt.lblAnzLKW.Text = rpt.Fields.Item("LKW").Value
|
||||
|
||||
rpt.lblMitarbeiter.Text = rpt.Fields.Item("Mitarbeiter").Value
|
||||
|
||||
sumSnd += CInt(rpt.Fields.Item("Sendungen").Value)
|
||||
sumLKW += CInt(rpt.Fields.Item("LKW").Value)
|
||||
End Sub
|
||||
AddHandler rpt.GroupHeader1.Format, Sub()
|
||||
' If CheckBox1.Checked Then rpt.lblFiliale.Text = SQL.getValueTxtBySql("SELECT CAST(FilialenNr as varchar (4)) + ' ' + Grenzstelle FROM filialen WHERE FilialenNr='" & rpt.Fields.Item("FilialenNr").Value & "'", "FMZOLL")
|
||||
sumSnd = 0
|
||||
sumLKW = 0
|
||||
End Sub
|
||||
AddHandler rpt.GroupFooter1.Format, Sub()
|
||||
rpt.lblAnzSndSum.Text = sumSnd
|
||||
rpt.lblAnzLKWSum.Text = sumLKW
|
||||
End Sub
|
||||
|
||||
print.Viewer.LoadDocument(rpt)
|
||||
print.Viewer.ViewType = GrapeCity.Viewer.Common.Model.ViewType.Continuous
|
||||
print.Show()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user