Appframe Knowledge Base


1 hits
0

Concatenating reports

Try
	Dim vCollection As Appframe3.Reporting.afReport
    Dim vDataTable As DataTable = afAccessLayer.GetData(vRecordSource)

    For Each vRow As DataRow In vDataTable.Rows
        Dim vReport As New Appframe3.Reporting.afReport("arpt_CRM_Test", "TestId = " + vRow("TestId").ToString())
        vReport.LoadLayoutAndData()
        vReport.CreateDocument()

        If vCollection Is Nothing Then
            vCollection = vReport
        Else
            vCollection.Pages.AddRange(vReport.Pages)
        End If
    Next

    Dim vMemoryStream As System.IO.MemoryStream = New System.IO.MemoryStream()
    vCollection.ExportToPdf(vMemoryStream)
    vMemoryStream.Seek(0, System.IO.SeekOrigin.Begin)
    Dim vFileStoreLayer As New Appframe3.Common.Data.afFileStoreLayer
    vFileStoreLayer.InsertFile(vMemoryStream, "test.pdf", "atbv_CRM_Tests", pPrimKey)
    Me.atbv_CRM_ProduksjonerFiles.RefreshDataSource()
Catch ex As Exception
    Throw
End Try

reporting win · Perma link post comment Posted by: Peter Øren (08-mai-2012)