Upgrating project to Active Reports v17 that exports PDF to mem stream

120 Views Asked by At

I'm upgrading to Grape City Active Reports v17 from v11 and I've run into some difficulty with the following code:

Dim pdf As PdfExport
Dim MyMemStream As System.IO.MemoryStream = New System.IO.MemoryStream
pdf.Export(MyRpt.Document, MyMemStream)
MyMemStream.Position = 0
Dim MyRptAttachment As Attachment = New Attachment(MyMemStream, "MyReport.pdf", "application/pdf")

The line pdf.Export(MyRpt.Document, MyMemStream) generates the following error:

Error BC30516 Overload resolution failed because no accessible 'Export' accepts this number of arguments.

Ok, I understand the error, but there is absolutely zero information as to what parameters are required in this situation. Nothing in the documentation addresses exactly what the parameters are required in this call. I've read and re-read the documentation at this link https://www.grapecity.com/activereportsnet/docs/latest/online/pdf-export.html, AND the documentation is apparently wrong as the reference to pdfExport cannot be resolved, I was able to solve that issue, but cannot figure out what parameters the export expects. This code ran without issues with Active Reports v11, I understand things change all the time, but some documentation would be nice.

1

There are 1 best solutions below

0
Bart McEndree On

You will need to review all of the breaking changes between v11 and v17. They can be found at

https://developer.mescius.com/activereportsnet/docs/latest/online/breaking-changes.html

https://developer.mescius.com/activereportsnet/docs/versions/v16/online/breaking-changes.html

We are on v13 and do our export in C# with this code:

var p = new PdfExport();
SetPdfExportOptions(ref p, sLangue, sAccn);
p.Export(frm.Document, sOutputPath + "." + sFileExtension);
p.Dispose();