Jonathan Jenne c2de72be74 30-11-23
2023-11-30 14:00:30 +01:00

17 lines
598 B
VB.net

Imports System.IO
Imports DevExpress.XtraPrinting
Public Class ReportCreator
Public Shared Async Function CreateReport(pReportItems As List(Of ReportItem)) As Task(Of Byte())
Dim oSource As New ReportSource With {.Items = pReportItems}
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