first pass of creating report

This commit is contained in:
Jonathan Jenne
2023-12-12 16:09:08 +01:00
parent 788d7fac9f
commit f8b30e1a06
12 changed files with 317 additions and 168 deletions

View File

@@ -1,30 +0,0 @@
Imports System.IO
Imports DevExpress.XtraPrinting
Public Class ReportCreator
Private Envelope As Envelope
Public Sub New(pEnvelope As Envelope)
Envelope = pEnvelope
End Sub
Public Async Function CreateReport(pReportItems As List(Of ReportItem)) As Task(Of Byte())
Dim oItems = pReportItems.Select(AddressOf MergeEnvelope).ToList()
Dim oSource As New ReportSource With {.Items = oItems}
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
Private Function MergeEnvelope(pItem As ReportItem) As ReportItem
If pItem.Envelope Is Nothing Then
pItem.Envelope = Envelope
End If
Return pItem
End Function
End Class

View File

@@ -1,12 +0,0 @@
Public Class ReportItem
Public Property Envelope As Envelope
Public Property EnvelopeId As Integer
Public Property EnvelopeTitle As String
Public Property EnvelopeSubject As String
Public Property ItemStatus As Constants.EnvelopeStatus
Public Property ItemUserReference As String
Public Property ItemDate As Date
End Class

View File

@@ -1,3 +0,0 @@
Public Class ReportSource
Public Property Items As List(Of ReportItem)
End Class