diff --git a/SDL/kunden/usrCntlKundenuebersicht.vb b/SDL/kunden/usrCntlKundenuebersicht.vb index 07d2283d..d70a6b9e 100644 --- a/SDL/kunden/usrCntlKundenuebersicht.vb +++ b/SDL/kunden/usrCntlKundenuebersicht.vb @@ -3370,7 +3370,14 @@ Public Class usrCntlKundenuebersicht Dim withPDF As Boolean = True '#wenn PDF und JSON in einem geht withPDF aus true! - Dim failureDesc As String = cs.getReport(company, withPDF) + Dim failureDesc As String = "" + + If withPDF Then + cs.getReport(company, withPDF, pdfObject) + Else + cs.getReport(company, withPDF, Nothing) + End If + If failureDesc <> "" Then MsgBox(failureDesc) Cursor = Cursors.Default diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/Creditsafe/cCreditSafeAPI.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/Creditsafe/cCreditSafeAPI.vb index a9d35bd0..6ab93367 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/Creditsafe/cCreditSafeAPI.vb +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/Creditsafe/cCreditSafeAPI.vb @@ -5,6 +5,7 @@ Imports System.Net Imports System.Reflection Imports System.Text.RegularExpressions Imports System.Threading +Imports iTextSharp.text.pdf Public Class cCreditSafeAPI @@ -1111,7 +1112,7 @@ Public Class cCreditSafeAPI End Sub - Shared Function getReport(ByRef company As Company, withPDF As Boolean) As String 'Shared Function getReport(ByRef company As Company, withPDF As Boolean, ByRef bytes As Byte()) As String + Shared Function getReport(ByRef company As Company, withPDF As Boolean, Optional ByRef bytes As Byte() = Nothing) As String Dim failureDesc As String = "" Dim myUrl As String = API_STRING & "/v1/companies/" & company.creditSafeId & "/" If company.country = "DE" Then @@ -1289,6 +1290,19 @@ Public Class cCreditSafeAPI company.csFailure = json.StringOf("details") End If + + If jsonRespString IsNot Nothing Then + Dim PDFReport As Chilkat.JsonObject = json.ObjectOf("pdfReportStream") + Dim pdfString = json.StringOf("pdfReportStream") + Dim pdfData2 As New Chilkat.BinData + success = pdfData2.AppendEncoded(pdfString, "base64") + If success Then + bytes = pdfData2.GetBinary + End If + Return failureDesc + End If + + Return failureDesc End Function