Appframe Knowledge Base


1 hits
0

How to export a report to PDF

Dim vFileName as String = Nothing
Dim vViewName as String = Nothing
Dim vPrimKey as String = Nothing

Dim vReport As New AppFrame3.Reporting.afReport(vReportID, vFilter)
vReport.LoadLayoutAndData()

Dim vMemoryStream As System.IO.MemoryStream = New System.IO.MemoryStream()
vReport.ExportToPdf(vMemoryStream)
vMemoryStream.Seek(0, System.IO.SeekOrigin.Begin)

Dim vFileStoreLayer As New AppFrame3.Common.Data.afFileStoreLayer
vFileStoreLayer.InsertFile(vMemoryStream, vFileName, vViewName, vPrimKey)

vMemoryStream.Close()

win · Perma link post comment Posted by: Peter Øren (13-jan-2012)

Kevin Francis Becker :
I needed to prepare a new row in the filestore table as per Trong's post https://www.pims.no/teamdoc?8088/151517/post-811237 (17-okt-2017)
Kevin Francis Becker :
Dim vTable As DataTable = CType(pFilestoreTableView.DataSource, DataTable) Dim vNewRow As DataRow = vTable.NewRow() vTable.Rows.Add(vNewRow) Dim vPrimKey = vNewRow("PrimKey").ToString() Dim vViewName = pFilestoreTableView.DataSource.ToString() (17-okt-2017)