Dim dcmCtxReportAfterRender As DcmContextReportAfterRender = CType(context, Sagede.OfficeLine.Engine.DcmContextReportAfterRender)
Dim report As Stimulsoft.Report.StiReport = CType(dcmCtxReportAfterRender.Report, Stimulsoft.Report.StiReport)
Dim StiSettings As New Stimulsoft.Report.Export.StiPdfExportSettings
Dim objMandant As Mandant = dcmCtxReportAfterRender.Mandant
Dim intMandant As Integer = dcmCtxReportAfterRender.Mandant.Id
TraceLog.Logger.Information("RL-PrintPDF fcExpBerichtAlsPDF - ReportKey: " & CStr(dcmCtxReportAfterRender.ReportKey))
Dim saSplitRepKey() As String = Split(dcmCtxReportAfterRender.ReportKey, ".")
Dim ReportBez As String = saSplitRepKey(0)
TraceLog.Logger.Information("RL-PrintPDF fcExpBerichtAlsPDF - ReportBez: " & ReportBez)
StiSettings.EmbeddedFonts = True
StiSettings.ImageQuality = 1
StiSettings.ImageResolution = 100
StiSettings.PdfACompliance = True
'Dim belegContext As DcmContextReport = CType(context, DcmContextReport)
'Dim ReportPart As Beleg = belegContext.ReportPart
Try
'Dim parameter As NamedParameters = DirectCast(dcmCtxReportAfterRender.Parameters, NamedParameters)
Dim ReportName As String = report.ReportName
sReportCaption = ConversionHelper.ToString(dcmCtxReportAfterRender.Parameters.FromName("$AccessCaption"))
TraceLog.Logger.Information("RL-PrintPDF fcExpBerichtAlsPDF - ReportCaption: " & CStr(sReportCaption))
Dim saSplitReportCaption() As String = Nothing
Dim saSplitReportCaptionValue() As String = Nothing
saSplitReportCaption = Split(sReportCaption, ";")
saSplitReportCaptionValue = Split(saSplitReportCaption(1), "=")
sReportCaption = saSplitReportCaptionValue(1)
TraceLog.Logger.Information("RL-PrintPDF fcExpBerichtAlsPDF - Variante: " & CStr(ReportName))
TraceLog.Logger.Information("RL-PrintPDF fcExpBerichtAlsPDF - ReportCaptionPart: " & CStr(sReportCaption))
If ReportName = ReportBez Then
ReportName = sReportCaption
End If
lngConnID = 0
lngConnID = objMandant.MultiUserServiceMain.ConnectionId
lngMahnTAN = 0
lngMahnTAN = ConversionHelper.ToInt32(dcmCtxReportAfterRender.Parameters.FromName("rptTANMahnung"))
Dim fileName As String = Nothing
fileName = ReportName & ".pdf"
TraceLog.Logger.Information("RL-PrintPDF fcExpBerichtAlsPDF - FileName: " & fileName & " / ConnID: " & CStr(lngConnID) & " / MahnTAN: " & CStr(lngMahnTAN))