Page 1 of 1

TargetInvocationException - Export to PDF

Posted: Mon Jan 04, 2010 7:46 am
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?


TargetInvocationException - Export to PDF

Posted: Mon Jan 04, 2010 11:23 am
by Jan
Hello,

Please uncheck "Use Digital Signature" check box.

Thank you.

TargetInvocationException - Export to PDF

Posted: Tue Jan 05, 2010 1:36 am
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();

TargetInvocationException - Export to PDF

Posted: Tue Jan 05, 2010 8:17 am
by Edward
Hi

Thank you for this feedback.