SavedEvent Event only fires on Save As
Posted: Wed Jun 11, 2008 2:41 pm
I've noticed some odd behavior associated with the SavedReport event hander.
Here is my code:
StiDesigner.SavedReport += new EventHandler(StiDesigner_SavedReport);
1) If you save a new report for the very first time, the event fires for either Save or Save As.
If you load a report, and do Save, the event does not fire. However, if you do a Save As, it does fire.
My guess on why it works for a new report is that when you do a Save it actually does a Save As.
2) The other odd behavior I noticed is that if you perform a Save As on a loaded report, the SavedReport handler fires two or three times. The first time it fires, the designer object is null. The second time it fires, the designer object is instantiated.
So for example: string filename = report.Designer.ReportFileName throws an exception the first time because Designer is null. But the second time it fires, it is there.
Are these known issues and if so, is there a workaround?
Thanks,
Jaime
Here is my code:
StiDesigner.SavedReport += new EventHandler(StiDesigner_SavedReport);
1) If you save a new report for the very first time, the event fires for either Save or Save As.
If you load a report, and do Save, the event does not fire. However, if you do a Save As, it does fire.
My guess on why it works for a new report is that when you do a Save it actually does a Save As.
2) The other odd behavior I noticed is that if you perform a Save As on a loaded report, the SavedReport handler fires two or three times. The first time it fires, the designer object is null. The second time it fires, the designer object is instantiated.
So for example: string filename = report.Designer.ReportFileName throws an exception the first time because Designer is null. But the second time it fires, it is there.
Are these known issues and if so, is there a workaround?
Thanks,
Jaime