Jonathan Jenne ca0c427908 Report
2023-11-30 16:37:45 +01:00

17 lines
644 B
VB.net

Imports System.IO
Imports DevExpress.XtraPrinting
Public Class ReportCreator
Public Shared Async Function CreateReport(pEnvelope As Envelope, pReportItems As List(Of ReportItem)) As Task(Of Byte())
Dim oSource As New ReportSource With {.Items = pReportItems, .Envelope = pEnvelope}
Dim oReport As New rptEnvelopeHistory() With {.DataSource = oSource, .DataMember = "Items"}
Await oReport.CreateDocumentAsync()
Using oStream As New MemoryStream()
Await oReport.ExportToPdfAsync(oStream, New PdfExportOptions)
Return oStream.ToArray()
End Using
End Function
End Class