30-11-23
This commit is contained in:
16
EnvelopeGenerator.Common/Reports/ReportCreator.vb
Normal file
16
EnvelopeGenerator.Common/Reports/ReportCreator.vb
Normal file
@@ -0,0 +1,16 @@
|
||||
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
|
||||
Reference in New Issue
Block a user