TargetInvocationException - Export to PDF

Stimulsoft Reports.NET discussion
Post Reply
DoA
Posts: 7
Joined: Tue Dec 01, 2009 6:36 am

TargetInvocationException - Export to PDF

Post by DoA »

HI

DLL versions 2009.3.600.0

I get a TargetInvocationException from StiPdfExportService when I try to export a report to PDF.
When I select save as PDF in the viewer menu, I must select a certificate before I can continue. If I select one one certificate (self created), then I get the following exception.

System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid. Check InnerException for exception details. ---> System.Exception: DigitalSign error at step 3, code #80004005: Cannot find the certificate and private key for decryption
at Stimulsoft.Report.Export.StiPdfExportService.ThrowDigitalSignError(Int32 step, String message, Boolean showCode)
at Stimulsoft.Report.Export.StiPdfExportService.ThrowDigitalSignError(Int32 step)
at Stimulsoft.Report.Export.StiPdfExportService.CreateSignature(Byte[] buf, Boolean getCertificateFromCryptoUI, String certificateID, Boolean useLocalMachineCertificates)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, StiExportService exportService, Stream stream, StiExportSettings settings)
at Stimulsoft.Report.Export.StiExportService.DoExport(StiExportInfo info)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

Why do I need to actually select a certificate to export to PDF?

Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

TargetInvocationException - Export to PDF

Post by Jan »

Hello,

Please uncheck "Use Digital Signature" check box.

Thank you.
DoA
Posts: 7
Joined: Tue Dec 01, 2009 6:36 am

TargetInvocationException - Export to PDF

Post by DoA »

Thank you!

The most obvious things are the simplest. :biggrin:

I ended up using this code in code behind:

Code: Select all

StiSettings.Load();
Stimulsoft.Report.StiSettings.Set("StiPdfExportSetupForm", "UseDigitalSignature", false);
StiSettings.Save();
report.ShowWithWpf();
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

TargetInvocationException - Export to PDF

Post by Edward »

Hi

Thank you for this feedback.
Post Reply