Gesamtsicherheiten: CSV Export
This commit is contained in:
@@ -117,6 +117,10 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\dll\ChillKat64\ChilkatDotNet47.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ClosedXML, Version=0.95.4.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\ClosedXML.0.95.4\lib\net46\ClosedXML.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="com.esendex.sdk, Version=3.8.0.0, Culture=neutral, PublicKeyToken=9dceac28a20578e2, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\esendex-dotnet-sdk.3.8.0\lib\net35\com.esendex.sdk.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
Imports System.Reflection
|
||||
Imports SDL
|
||||
Imports Spire.PdfViewer.Forms
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
Public Class frmGesamtsicherheitenMenuNEU
|
||||
|
||||
@@ -234,7 +236,7 @@ Public Class frmGesamtsicherheitenMenuNEU
|
||||
csvexport(dgvListe)
|
||||
End Sub
|
||||
|
||||
Public Shared Function csvexport(quelldgv As DataGridView, Optional quelldgv2 As DataGridView = Nothing)
|
||||
Public Shared Function csvexport(quelldgv As DataGridView)
|
||||
Dim savefiledialog As New SaveFileDialog
|
||||
Dim firstin As String
|
||||
Dim out As String
|
||||
@@ -245,62 +247,6 @@ Public Class frmGesamtsicherheitenMenuNEU
|
||||
savefiledialog.InitialDirectory = "C:\Verag"
|
||||
savefiledialog.ShowDialog()
|
||||
|
||||
If quelldgv2 IsNot Nothing Then
|
||||
|
||||
Try
|
||||
For r As Integer = 0 To quelldgv.Rows.Count - 1
|
||||
For c As Integer = 0 To quelldgv.Columns.Count
|
||||
'test &= r & c & vbCrLf
|
||||
Try
|
||||
'test &= Replace(quelldgv.Rows(r).Cells(c).Value.ToString, vbCrLf, "vbCrlLf")
|
||||
firstin = quelldgv.Rows(r).Cells(c).Value.ToString
|
||||
'in2 = """" & firstin & """" & ";"
|
||||
in2 = firstin & ";"
|
||||
out &= Replace(in2, vbCrLf, "##vbCrLf##")
|
||||
out = Replace(out, "€", "")
|
||||
Catch ex As Exception
|
||||
out &= ""
|
||||
End Try
|
||||
|
||||
Next
|
||||
|
||||
For c As Integer = 0 To quelldgv2.Columns.Count
|
||||
'test &= r & c & vbCrLf
|
||||
Try
|
||||
'test &= Replace(quelldgv.Rows(r).Cells(c).Value.ToString, vbCrLf, "vbCrlLf")
|
||||
firstin = quelldgv2.Rows(r).Cells(c).Value.ToString
|
||||
'in2 = """" & firstin & """" & ";"
|
||||
in2 = firstin & ";"
|
||||
out &= Replace(in2, vbCrLf, "##vbCrLf##")
|
||||
out = Replace(out, "€", "")
|
||||
Catch ex As Exception
|
||||
out &= ""
|
||||
End Try
|
||||
|
||||
Next
|
||||
|
||||
out &= "nZ"
|
||||
Next
|
||||
For c As Integer = 0 To quelldgv.Columns.Count - 1
|
||||
header &= quelldgv.Columns(c).Name & ";"
|
||||
Next
|
||||
For c As Integer = 0 To quelldgv2.Columns.Count - 1
|
||||
header &= quelldgv2.Columns(c).Name & ";"
|
||||
Next
|
||||
out = Replace(out, "nZ", vbCrLf)
|
||||
'MsgBox(out)
|
||||
Using sw As New IO.StreamWriter(savefiledialog.FileName)
|
||||
sw.WriteLine(header)
|
||||
sw.WriteLine(out)
|
||||
End Using
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
|
||||
|
||||
Else
|
||||
|
||||
Try
|
||||
For r As Integer = 0 To quelldgv.Rows.Count - 1
|
||||
For c As Integer = 0 To quelldgv.Columns.Count
|
||||
@@ -333,7 +279,6 @@ Public Class frmGesamtsicherheitenMenuNEU
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
@@ -496,21 +441,20 @@ Public Class frmGesamtsicherheitenMenuNEU
|
||||
|
||||
Private Sub ExportCSV2ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExportCSV2ToolStripMenuItem.Click
|
||||
|
||||
Dim frm As New frmGesamtsicherheitenNEU
|
||||
With frm
|
||||
.currentGesSichRef = GesSichRef
|
||||
.gessicherheitID = dgvListe.CurrentRow.Cells("gs_gsnr").Value
|
||||
.Standort = Me.Standort
|
||||
.datum = dgvListe.CurrentRow.Cells("gs_datum").Value
|
||||
.LKWKZ = dgvListe.CurrentRow.Cells("gs_LKWKZ").Value
|
||||
.FilialNummer = dgvListe.CurrentRow.Cells("gs_filialenNr").Value
|
||||
.Abfertigungsnummer = dgvListe.CurrentRow.Cells("gs_abfertigungsNr").Value
|
||||
.warenortID = dgvListe.CurrentRow.Cells("gs_warenort").Value
|
||||
.dataTable = Me.dataTable
|
||||
End With
|
||||
If dgvListe.SelectedRows.Count > 0 Then
|
||||
Dim list As New List(Of Integer)
|
||||
|
||||
frm.LoadDGVSicherheitenForExport()
|
||||
frm.LoadDGVSicherheitsPosForExport(frm.gessicherheitID)
|
||||
csvexport(frm.dgvGesamtsicherheit, frm.dgvSicherheitsPos)
|
||||
For Each row As DataGridViewRow In dgvListe.SelectedRows
|
||||
list.Add(CInt(row.Cells("gs_gsnr").Value))
|
||||
|
||||
|
||||
Next
|
||||
Dim frm As New frmGesamtsicherheitenNEU
|
||||
frm.LoadDGVSicherheitenForExport(list)
|
||||
|
||||
SDL.cProgramFunctions.genExcelFromDGV_NEW(frm.dgvGesamtsicherheit)
|
||||
|
||||
'csvexport(frm.dgvGesamtsicherheit)
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
Imports System.Linq.Expressions
|
||||
Imports GrapeCity.Viewer.Common.Model
|
||||
Imports Org.BouncyCastle.Cms
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
Public Class frmGesamtsicherheitenNEU
|
||||
@@ -148,11 +149,25 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub LoadDGVSicherheitenForExport(Optional withFilterParam As Boolean = False)
|
||||
Public Sub LoadDGVSicherheitenForExport(list As List(Of Integer))
|
||||
|
||||
Dim gsnr As String
|
||||
Dim counter = 0
|
||||
For Each n In list
|
||||
gsnr &= n.ToString()
|
||||
counter = counter + 1
|
||||
If (list.Count <> 0 And counter <> list.Count) Then
|
||||
gsnr &= ","
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
Dim SQLStringSicherheit As String = "select [gs_gsId] as ID, [gs_ATBNr] as 'ATB Verwahrlager', CONVERT(VARCHAR(10),gs_datum, 120) as Datum, CONVERT(VARCHAR(5),gs_datum, 108) as Uhrzeit, [gs_warenwert] as Warenwert, [gs_sicherheitsbetrag] as Sicherheitbetrag, [gs_saldo] as Saldo, [gs_freitext] as Freitext, [gs_atr] as 'ATR ja/nein', [gs_ust] as '19% EUSt' from [tblGesamtsicherheit] where [gs_gsnr] = '" & gessicherheitID & "'" & "order by gs_gsId"
|
||||
Dim SQLStringSicherheit As String = "select [gs_gsId] as Id, [gs_ATBNr] as 'ATB Verwahrlager', CAST(gs_datum as Date) as Datum, CONVERT(VARCHAR(5),gs_datum, 108) as Uhrzeit, [gs_warenwert] as Warenwert, [gs_sicherheitsbetrag] as Sicherheitbetrag, [gs_freitext] as Freitext, [gs_atr] as 'ATR ja/nein', [gs_ust] as '19% EUSt',
|
||||
[gsp_ATCNr] as 'ATCNr oder MRN eroeffnet', CAST(gsp_erstellungsdatum as Date) as Datum, CONVERT(VARCHAR(5),gsp_erstellungsdatum, 108) as Uhrzeit, [gsp_warenwert] as Warenwert, [gsp_sicherheitsbetrag] as Sicherheitsbetrag, [gsp_freitext] as Freitext, [gs_saldo] as Saldo
|
||||
from [tblGesamtsicherheit]
|
||||
inner join [tblGesamtsicherheitsPositionen] on [tblGesamtsicherheit].gs_gsId = [tblGesamtsicherheitsPositionen].gsp_gsId
|
||||
where [gs_gsnr] IN (" & gsnr & ")
|
||||
order by gs_gsId"
|
||||
|
||||
dgvGesamtsicherheit.SET_SQL(SQLStringSicherheit, "AVISO", ,)
|
||||
dgvGesamtsicherheit.LOAD()
|
||||
@@ -233,19 +248,6 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub LoadDGVSicherheitsPosForExport(gsNr As Integer, Optional withFilterParam As Boolean = False)
|
||||
|
||||
Dim sqlSearchSting As String = ""
|
||||
|
||||
Dim SQLStringCRN As String =
|
||||
"select [gsp_gsId] as IDPos, [gsp_ATCNr] as 'ATCNr oder MRN eroeffnet', CONVERT(VARCHAR(10),gsp_erstellungsdatum, 120) as Datum, CONVERT(VARCHAR(5),gsp_erstellungsdatum, 108) as Uhrzeit, [gsp_warenwert] as Warenwert, [gsp_sicherheitsbetrag] as Sicherheitsbetrag, [gsp_freitext] as Freitext" &' ,[gsp_avisoId] ,[gsp_ust] ,[gsp_filialenNr],[gsp_abfertigungsNr] ,[gsp_MRNNr], [gsp_art]
|
||||
" From [tblGesamtsicherheitsPositionen] where [gsp_gsnr] = '" & gsNr & "' order by [gsp_gsId]"
|
||||
|
||||
dgvSicherheitsPos.SET_SQL(SQLStringCRN, "AVISO", ,)
|
||||
dgvSicherheitsPos.LOAD()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
'Private Sub dgvSicherheitsPos_SelectionChanged(sender As Object, e As EventArgs) Handles dgvSicherheitsPos.SelectionChanged
|
||||
' If dgvSicherheitsPos.SelectedRows.Count > 0 Then
|
||||
|
||||
Reference in New Issue
Block a user