Show Message when exporting report by hand

This commit is contained in:
Jonathan Jenne
2022-04-21 15:51:13 +02:00
parent 3623138fd1
commit ad671443b9

View File

@@ -282,9 +282,21 @@ Public Class frmImportMain
' Generate the report
Dim oReport = ReportGenerator.GenerateReport(oDocument, CurrentTemplate)
Dim oFilePath = ReportGenerator.GetReportFilePath(oDocument, CurrentTemplate)
Dim oFileInfo = New FileInfo(oFilePath)
' Export it to pdf
oReport.ExportToPdf(oFilePath)
Dim oMessage = $"Die Datei wurde im Verzeichnis '{oFileInfo.Directory}' abgelegt. Möchten Sie die Datei jetzt öffnen?"
Dim oResult = MsgBox(oMessage, MsgBoxStyle.Question Or MsgBoxStyle.YesNo, Text)
If oResult = MsgBoxResult.Yes Then
Try
Process.Start(oFilePath)
Catch ex As Exception
FormHelper.ShowError(ex, "Export Report")
End Try
End If
End Sub
Private Async Sub btnTestTransferFile_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnTestTransferFile.ItemClick
@@ -739,6 +751,9 @@ Public Class frmImportMain
WebService.RaiseWebServiceProgress("Bericht erzeugen")
' Generate the report
' TODO: Call GetReportFilePath in GenerateReport to better control
' when filename is generated and use it as placeholder
Dim oReport = ReportGenerator.GenerateReport(pDocument, CurrentTemplate)
Dim oFilePath = ReportGenerator.GetReportFilePath(pDocument, CurrentTemplate)