first pass of creating report
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class ReportSource
|
||||
Public Property Items As List(Of ReportItem)
|
||||
End Class
|
||||
Reference in New Issue
Block a user