Improve Loading report, add TODOs

This commit is contained in:
Jonathan Jenne 2021-11-15 10:59:45 +01:00
parent 29960916a0
commit e764c310ea
6 changed files with 60 additions and 16 deletions

View File

@ -501,7 +501,7 @@ Partial Public Class OrderReport
'Detail1
'
Me.Detail1.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.XrLabel3, Me.table4})
Me.Detail1.HeightF = 47.45839!
Me.Detail1.HeightF = 29.16666!
Me.Detail1.Name = "Detail1"
'
'XrLabel3

View File

@ -154,6 +154,15 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Erstellen der Berichtsvorschau ähnelt.
'''</summary>
Friend Shared ReadOnly Property Erstellen_der_Berichtsvorschau() As String
Get
Return ResourceManager.GetString("Erstellen der Berichtsvorschau", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Es konnte kein passender Mandant anhand der geladenen Daten ermittelt werden. Bitte wählen Sie einen aus der Liste. ähnelt.
'''</summary>

View File

@ -141,6 +141,9 @@
<data name="Eingangsverzeichnis" xml:space="preserve">
<value>Eingangsverzeichnis</value>
</data>
<data name="Erstellen der Berichtsvorschau" xml:space="preserve">
<value>Erstellen der Berichtsvorschau</value>
</data>
<data name="Es konnte kein passender Mandant ermittelt werden" xml:space="preserve">
<value>Es konnte kein passender Mandant anhand der geladenen Daten ermittelt werden. Bitte wählen Sie einen aus der Liste.</value>
</data>

View File

@ -169,28 +169,28 @@ Public Class frmImportMain
If oTableCounter = 0 Then
Dim oGrid = GridLoader.GetGridFromElement(GridControl1, oTable)
AddHandler oGrid.DoubleClick, AddressOf Grid_MouseDoubleClick
AddHandler DirectCast(oGrid.FocusedView, GridView).CustomDrawCell, AddressOf GridView_CustomDrawCell
AddHandler GridView1.CustomDrawCell, AddressOf GridView_CustomDrawCell
oGrids.Add(oGrid)
End If
If oTableCounter = 1 Then
Dim oGrid = GridLoader.GetGridFromElement(GridControl2, oTable)
AddHandler oGrid.DoubleClick, AddressOf Grid_MouseDoubleClick
AddHandler DirectCast(oGrid.FocusedView, GridView).CustomDrawCell, AddressOf GridView_CustomDrawCell
AddHandler GridView2.CustomDrawCell, AddressOf GridView_CustomDrawCell
oGrids.Add(oGrid)
End If
If oTableCounter = 2 Then
Dim oGrid = GridLoader.GetGridFromElement(GridControl3, oTable)
AddHandler oGrid.DoubleClick, AddressOf Grid_MouseDoubleClick
AddHandler DirectCast(oGrid.FocusedView, GridView).CustomDrawCell, AddressOf GridView_CustomDrawCell
AddHandler GridView3.CustomDrawCell, AddressOf GridView_CustomDrawCell
oGrids.Add(oGrid)
End If
If oTableCounter = 3 Then
Dim oGrid = GridLoader.GetGridFromElement(GridControl4, oTable)
AddHandler oGrid.DoubleClick, AddressOf Grid_MouseDoubleClick
AddHandler DirectCast(oGrid.FocusedView, GridView).CustomDrawCell, AddressOf GridView_CustomDrawCell
AddHandler GridView4.CustomDrawCell, AddressOf GridView_CustomDrawCell
oGrids.Add(oGrid)
End If
@ -515,7 +515,37 @@ Public Class frmImportMain
End Sub
Private Sub btnOpenReport_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenReport.ItemClick
Dim oDocument As Document = GridViewFiles.GetRow(GridViewFiles.FocusedRowHandle)
Try
SplashScreenManager.ShowWaitForm()
SplashScreenManager.SetWaitFormDescription(My.Resources.frmImportMainExtra.Erstellen_der_Berichtsvorschau)
SetDocumentButtonsEnabled(False)
GridControlFiles.Enabled = False
btnLoadFiles.Enabled = False
SplitContainerGrids.Enabled = False
Dim oDocument As Document = GridViewFiles.GetRow(GridViewFiles.FocusedRowHandle)
Dim oPrintTool As ReportPrintTool = GenerateReport(oDocument)
oPrintTool.ShowPreview()
SplitContainerGrids.Enabled = True
btnLoadFiles.Enabled = True
GridControlFiles.Enabled = True
SetDocumentButtonsEnabled(True)
SplashScreenManager.CloseWaitForm()
Catch ex As Exception
FormHelper.ShowError(ex, My.Resources.frmImportMainExtra.Erstellen_der_Berichtsvorschau)
End Try
End Sub
Private Function GenerateReport(pDocument As Document) As ReportPrintTool
Dim oPrintTool As ReportPrintTool = Nothing
Dim oMapperConfig As New Mapper(LogConfig)
Dim oHeadMapper = oMapperConfig.GetMapper(Of ReportHead)(New Dictionary(Of String, String) From {
{"Fakt_Kontonummer[Final]", "Text2"},
@ -534,11 +564,11 @@ Public Class frmImportMain
{"Umsatzsteuerprozent_Zeile", "Text9"}
})
Dim oHeadRow = oDocument.Rows.
Dim oHeadRow = pDocument.Rows.
Where(Function(r) r.Name.EndsWith("T025")).
Select(Function(r) r.Fields).
FirstOrDefault()
Dim oPositionRows = oDocument.Rows.
Dim oPositionRows = pDocument.Rows.
Where(Function(r) r.Name.EndsWith("T026")).
ToList()
@ -570,10 +600,11 @@ Public Class frmImportMain
oDataSource.Fill()
oReport.DataSource = oDataSource
Dim printTool As New ReportPrintTool(oReport)
printTool.Report.CreateDocument(False)
printTool.ShowPreviewDialog()
End Sub
oPrintTool = New ReportPrintTool(oReport)
oPrintTool.Report.CreateDocument(False)
Return oPrintTool
End Function
Private Sub GridViewFiles_CustomDrawCell(sender As Object, e As Views.Base.RowCellCustomDrawEventArgs) Handles GridViewFiles.CustomDrawCell
Dim oDocument As Document = GridViewFiles.GetRow(e.RowHandle)

View File

@ -145,6 +145,10 @@ Namespace Documents
Where(Function(t) t.Name = oTopLevelElement.Name).
FirstOrDefault()
' TODO: All fields in the schema should be generated,
' only creating the ones with values leads to wrong visual cues when asking for
' docs/rows/fields with errors
For Each oSubElement As XElement In oSubElements
Dim oSchemaField = oTable.Columns.
Where(Function(c) c.Name = oSubElement.Name).

View File

@ -415,16 +415,13 @@ Namespace Winline
If p.Fields.ContainsKey("Artikelnummer") Then
Return p.Fields.Item("Artikelnummer").Original
Else
' TODO: Throw or ignore?
Throw New Exceptions.MissingAttributeException("Artikelnummer")
End If
End Function).
Distinct().
ToList()
'Dim oPositions As List(Of Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026) = pData.Items.
' Where(Function(i) TypeOf i Is Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026).
' Select(Of Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026)(Function(i) i).
' ToList()
Dim oYear = GetWinLineYear()
Dim oMandatorId As String = String.Empty
Dim oWhitelistedMandators = Mandators.