How to add an event before Report Print?
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?
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?