Hi, When user enters into design mode I need the "Save changes?" query to pop up regardless of him making any changes or not. Also I need to know what he pressed (Yes, No, Cancel). Can I do it without overwriting the whole saving process?
Use the Report.Template.OnLoadEnd event to set Report.Modified to true. That would surely always force the save dialog to show when they exit the designer or try to load another report.
To detect what they did, you'll have to make your own save dialog. This will require the OnCustomSaveDoc event to be assigned on the designer and you'll have to control the saving process.
Thanks for Report.Modified. But do you have any examples or tutorials concerning saving within OnCustomSaveDoc matter? I don't quite understand what do you mean by controlling saving process. Will I just have to override several methods or do I must to create this saving from scratch? And if so, then what do I need to do for that?
You'll have to implement the entire saving process, which isn't as much as it sounds like, because there is a method on the template to save to file. By default, if you don't assign this event handler, the designer calls Report.Template.Save. So, what you'll have to do is show a save dialog (so you can access the result), and then call Report.Template.SaveToFile based on the file they selected to save to. Set Report.Template.FileName before calling SaveToFile.
Comments
would surely always force the save dialog to show when they exit the
designer or try to load another report.
To detect what they did, you'll have to make your own save dialog. This will
require the OnCustomSaveDoc event to be assigned on the designer and you'll
have to control the saving process.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
But do you have any examples or tutorials concerning saving within
OnCustomSaveDoc matter? I don't quite understand what do you mean by
controlling saving process. Will I just have to override several methods or
do I must to create this saving from scratch? And if so, then what do I need
to do for that?
Thanks,
MB
it sounds like, because there is a method on the template to save to file.
By default, if you don't assign this event handler, the designer calls
Report.Template.Save. So, what you'll have to do is show a save dialog (so
you can access the result), and then call Report.Template.SaveToFile based
on the file they selected to save to. Set Report.Template.FileName before
calling SaveToFile.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com