diff --git a/Controls.DocumentViewer/DocumentViewer.vb b/Controls.DocumentViewer/DocumentViewer.vb index 1441527d..ae6191af 100644 --- a/Controls.DocumentViewer/DocumentViewer.vb +++ b/Controls.DocumentViewer/DocumentViewer.vb @@ -606,14 +606,20 @@ Public Class DocumentViewer End Function Private Sub FitToPage() - GdViewer.ZoomMode = ViewerZoomMode.ZoomModeFitToViewer + If Not GdViewer Is Nothing Then + GdViewer.ZoomMode = ViewerZoomMode.ZoomModeFitToViewer + End If End Sub Private Sub FitToWidth() - GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer + If Not GdViewer Is Nothing Then + GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer + End If + End Sub Private Function DoLoadFile(Stream As Stream, Extension As String) As Boolean + Try SpreadsheetControl1.Visible = False diff --git a/GUIs.Test.ZUGFeRDTest/Form1.vb b/GUIs.Test.ZUGFeRDTest/Form1.vb index f8872e9b..aebbdcb7 100644 --- a/GUIs.Test.ZUGFeRDTest/Form1.vb +++ b/GUIs.Test.ZUGFeRDTest/Form1.vb @@ -159,9 +159,41 @@ Public Class Form1 If oResult = DialogResult.OK Then Try - Dim oDoc = _zugferd.ValidateZUGFeRDFileWithGDPicture(OpenFileDialog1.FileName) + Dim oDoc = _zugferd.ValidateZUGFeRDFileWithGDPicture(OpenFileDialog1.FileName, True) + Dim oZFResult = _zugferd.ValidateZUGFeRDDocument(oDoc) Dim oZUGFERD = _zugferd.SerializeZUGFeRDDocument(oDoc) - Console.WriteLine() + WriteLog("Specification: " & oZFResult.Specification) + 'WriteLog("XML-Schema: " & oResult.UsedXMLSchema) + WriteLog("Embedded File Name: " & oZFResult.DataFileName) + + Dim oSpecification = oZFResult.Specification + + If oSpecification = ZUGFeRDInterface.ZUGFERD_SPEC_10 Then + oSpecification = ZUGFeRDInterface.ZUGFERD_SPEC_DEFAULT + End If + + Dim oPropertyMap = oArgs.PropertyMapList. + Where(Function(kv) kv.Specification = oSpecification). + ToDictionary(Function(kv) kv.XMLPath, Function(kv) kv) + + Dim oResult2 = _zugferd.PropertyValues.CheckPropertyValues(oZFResult.SchemaObject, oPropertyMap, "test") + + WriteLog("Valid Properties: [{0}]", oResult2.ValidProperties.Count) + For Each Prop In oResult2.ValidProperties + If Prop.Value.Length > 250 Then + WriteLog("Property: [{0}] = [{1}]", Prop.Description, Prop.Value.Substring(0, 250)) + Else + WriteLog("Property: [{0}] = [{1}]", Prop.Description, Prop.Value) + End If + Next + + WriteLog("--------------------------------") + WriteLog("Missing Properties: [{0}]", oResult2.MissingProperties.Count) + For Each Prop In oResult2.MissingProperties + WriteLog("Missing Property: [{0}]", Prop.ToString) ''Prop.Description + Next + + WriteLog("--------------------------------") Catch ex As DigitalData.Modules.Interfaces.Exceptions.ZUGFeRDExecption Dim oErrorCode = GetRejectionCodeNumber(ex.ErrorCode) Dim oMessage = oErrorCode + " - (" + ex.ErrorCode.ToString() + ") - " + ex.Message @@ -169,6 +201,7 @@ Public Class Form1 Catch ex As Exception MsgBox(ex.Message) End Try + MsgBox("Finished - check log") End If End Sub @@ -227,7 +260,7 @@ Public Class Form1 Try If oDialogResult = DialogResult.OK Then - Dim oDoc = _zugferd.ValidateZUGFeRDFileWithGDPicture(OpenFileDialog1.FileName) + Dim oDoc = _zugferd.ValidateZUGFeRDFileWithGDPicture(OpenFileDialog1.FileName, True) Dim oResult = _zugferd.ValidateZUGFeRDDocument(oDoc) oResult = _zugferd.SerializeZUGFeRDDocument(oDoc) diff --git a/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj b/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj index 385bed77..1c9fbff1 100644 --- a/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj +++ b/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj @@ -17,25 +17,26 @@ - + + - ..\..\DDModules\Config\bin\Debug\net8.0-windows\DigitalData.Modules.Config.dll + ..\..\DDModules\Config\bin\Debug\DigitalData.Modules.Config.dll - ..\..\DDModules\Database\bin\Debug\net8.0-windows\DigitalData.Modules.Database.dll + ..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll - ..\..\DDModules\Interfaces\bin\Debug\net8.0-windows\DigitalData.Modules.Interfaces.dll + ..\..\DDModules\Interfaces\bin\Debug\DigitalData.Modules.Interfaces.dll - ..\..\DDModules\Jobs\bin\Debug\net8.0-windows\DigitalData.Modules.Jobs.dll + ..\..\DDModules\Jobs\bin\Debug\DigitalData.Modules.Jobs.dll - ..\..\DDModules\Logging_.NET8\bin\Debug\net8.0-windows\DigitalData.Modules.Logging.dll + ..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll