MS New Report

This commit is contained in:
2022-12-13 15:46:27 +01:00
parent a430ed2a42
commit 9c80538fd8
16 changed files with 1709 additions and 78 deletions

View File

@@ -299,29 +299,58 @@ Public Class MyService
Logger.Info($"#### Trying to Create_EB_Report (EB-Protokoll) for DocID: {pDocID} - GENID: {GENID}... ####")
Dim errortext As String
Dim oStep As String
Try
Dim oReport As New XtraReportEB()
Dim oReport As New XtraReportSR()
Dim oDatasource As SqlDataSource = oReport.DataSource
'Parameter für 1.Query
Dim oSelectQuery As CustomSqlQuery = oDatasource.Queries(0)
'-------
If oSelectQuery.Parameters.Count = 1 Then
Logger.Debug($"Exactly [{oSelectQuery.Parameters.Count}] Parameter in Query 1!")
Else
Delete_EB2bCreated(pDocID)
Logger.Warn($"There is no parameter in Query 1 - Check the parameters for Query1")
DocID = 0
Exit Sub
End If
'-------
Logger.Debug($"Now passing the value [{pDocID}] to parameter 0 of Query 1...")
oStep = $"Now passing the value [{pDocID}] to parameter 0 of Query 1..."
Dim oParameter As QueryParameter = oSelectQuery.Parameters(0)
oParameter.Value = pDocID
'---------
Logger.Debug($"Parameter passed successfully!")
oStep = $"Parameter passed successfully!"
'---------
'Parameter für 2.Query
Dim oSelectQuery2 As CustomSqlQuery = oDatasource.Queries(1)
Dim oParameter2 As QueryParameter = oSelectQuery2.Parameters(0)
oParameter2.Value = pDocID
' Dim oSelectQuery2 As CustomSqlQuery = oDatasource.Queries(1)
' Dim oParameter2 As QueryParameter = oSelectQuery2.Parameters(0)
' oParameter2.Value = pDocID
DocID = pDocID
Try
'Logger.Debug($"Now passing the value [{pDocID}] to parameter pDocID...")
'----------
'If oReport.Parameters.Count = 1 Then
'Logger.Debug($"Exactly [{oReport.Parameters.Count}] Parameter!")
'Else
'Delete_EB2bCreated(pDocID)
'Logger.Warn($"There is no parameter in Report - Check the parameters for pDocID-Parameter")
'DocID = 0
'Exit Sub
'End If
'oReport.Parameters("pDocID").Value = pDocID
'oReport.FilterString = oFilter
'----------
oReport.ReportPrintOptions.PrintOnEmptyDataSource = False
oReport.FilterString = "DocID = " + pDocID
oStep = $"Trying to create the report-document.."
oReport.CreateDocument(False)
Logger.Debug($"oReport successfully created!")
Catch ex As Exception
Delete_EB2bCreated(pDocID)
Logger.Warn($"Unexpected Error in Create_EB_Report Create for DocID: {pDocID} - GENID: {GENID} - ERROR: {ex.Message}")
Logger.Warn($"Unexpected Error in Create_EB_Report - STEP: [{oStep}] - Create for DocID: {pDocID} - GENID: {GENID} - ERROR: {ex.Message}")
DocID = 0
Exit Sub
End Try