Printed event - 'Method not found' exception

Stimulsoft Reports.Wpf discussion
Post Reply
Irena
Posts: 9
Joined: Wed Feb 19, 2020 7:21 am

Printed event - 'Method not found' exception

Post by Irena » Mon May 17, 2021 10:39 am

Hello,

I want to close Print Preview window after sending report to the printer. My report is subscribed to Printed event.

Code: Select all

private void Report_Printed(object sender, EventArgs e)
{
    var dialogResult = (sender as StiReport).PrinterSettings.PrintDialogResult;

    if (dialogResult == Stimulsoft.System.Windows.Forms.DialogResult.OK)
    {
        //close print preview window
    }
}
But before entering event handler some unhandled exception occurs. Therefore, this situation cannot be debugged.
Unhandled Exception.jpg
Unhandled Exception.jpg (26.3 KiB) Viewed 2684 times
Do you know what can cause the problem?
Thanks in advance for your support.
Lech Kulikowski
Posts: 3665
Joined: Tue Mar 20, 2018 5:34 am

Re: Printed event - 'Method not found' exception

Post by Lech Kulikowski » Wed May 19, 2021 11:38 am

Hello,

Please send us a sample that reproduces the issue for analysis.

Thank you.
Irena
Posts: 9
Joined: Wed Feb 19, 2020 7:21 am

Re: Printed event - 'Method not found' exception

Post by Irena » Thu May 20, 2021 9:23 am

Link to the project: https://drive.google.com/file/d/1ukA6K1 ... sp=sharing

Thanks in advance.
Lech Kulikowski
Posts: 3665
Joined: Tue Mar 20, 2018 5:34 am

Re: Printed event - 'Method not found' exception

Post by Lech Kulikowski » Mon May 24, 2021 7:56 pm

Hello,

You should use compiled report. Please check the last release build in which was added Compilation in the NET Core:
lReport.CompiledReport.Printed += CompiledReport_Printed;

Thank you.
Post Reply