How to add an event before Report Print?

edited April 2014 in FastReport .NET
I want to add an event before report print, here is code:

public class FrReport : Report
{
.......
public event EventHandler BeforePrint;
public event EventHandler AfterPrint;

public new void Print()
{
if (BeforePrint != null)
BeforePrint(this, EventArgs.Empty);
base.Print();
if (AfterPrint != null)
AfterPrint(this, EventArgs.Empty);
}
}

When I call FrReport.Print,everything is OK,but when the Report show,
the Print Button on the preview Form is Clicked,It does not call Print() method,
Why? What should I do?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.