diff --git a/MultiTool.Form/Reports/OrderReport.Designer.vb b/MultiTool.Form/Reports/OrderReport.Designer.vb index c395a74..ad2b6b6 100644 --- a/MultiTool.Form/Reports/OrderReport.Designer.vb +++ b/MultiTool.Form/Reports/OrderReport.Designer.vb @@ -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 diff --git a/MultiTool.Form/Strings/frmImportMainExtra.Designer.vb b/MultiTool.Form/Strings/frmImportMainExtra.Designer.vb index d784d69..7ed45ad 100644 --- a/MultiTool.Form/Strings/frmImportMainExtra.Designer.vb +++ b/MultiTool.Form/Strings/frmImportMainExtra.Designer.vb @@ -154,6 +154,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Sucht eine lokalisierte Zeichenfolge, die Erstellen der Berichtsvorschau ähnelt. + ''' + Friend Shared ReadOnly Property Erstellen_der_Berichtsvorschau() As String + Get + Return ResourceManager.GetString("Erstellen der Berichtsvorschau", resourceCulture) + End Get + End Property + ''' ''' 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. ''' diff --git a/MultiTool.Form/Strings/frmImportMainExtra.resx b/MultiTool.Form/Strings/frmImportMainExtra.resx index 093a7e3..3d0a36f 100644 --- a/MultiTool.Form/Strings/frmImportMainExtra.resx +++ b/MultiTool.Form/Strings/frmImportMainExtra.resx @@ -141,6 +141,9 @@ Eingangsverzeichnis + + Erstellen der Berichtsvorschau + Es konnte kein passender Mandant anhand der geladenen Daten ermittelt werden. Bitte wählen Sie einen aus der Liste. diff --git a/MultiTool.Form/frmImportMain.vb b/MultiTool.Form/frmImportMain.vb index 6666dce..f92326e 100644 --- a/MultiTool.Form/frmImportMain.vb +++ b/MultiTool.Form/frmImportMain.vb @@ -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) diff --git a/MultiTool.Shared/Documents/DocumentLoader.vb b/MultiTool.Shared/Documents/DocumentLoader.vb index ab248e5..f15dd94 100644 --- a/MultiTool.Shared/Documents/DocumentLoader.vb +++ b/MultiTool.Shared/Documents/DocumentLoader.vb @@ -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). diff --git a/MultiTool.Shared/Winline/WinlineData.vb b/MultiTool.Shared/Winline/WinlineData.vb index 5ae4fc0..8e3869f 100644 --- a/MultiTool.Shared/Winline/WinlineData.vb +++ b/MultiTool.Shared/Winline/WinlineData.vb @@ -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.