FastReport.EnvironmentSettings frsetting = new FastReport.EnvironmentSettings();
frsetting.DesignerSettings.Restrictions.DontSaveReport = true;
// for test
// FastReport.Report report = new FastReport.Report();
// report .Design();
FastReport.EnvironmentSettings frsetting = new FastReport.EnvironmentSettings();
frsetting.DesignerSettings.Restrictions.DontSaveReport = true;
// for test
// FastReport.Report report = new FastReport.Report();
// report .Design();
use the code above before loading your report ...
Hi,
The above code disables the save and save as menu items.
But I want to disable only the " Save as " menu item.
Any ideas ?
Also I have another doubt. If I load a report from a database, modify it and then click save, will the report be saved in the respective database ?
1)
This code will make " Save as" menu inactive ..... NOT disable
by adding a custom code , for the "save", "save as" menu
// call this before load your report
private void InitSettings ()
{
      EnvironmentSettings FastReportSetting = new EnvironmentSettings();
        FastReportSetting.DatabaseLogin += new DatabaseLoginEventHandler(FastReportSetting_DatabaseLogin);
        FastReportSetting.CustomSaveDialog += new FastReport.Design.OpenSaveDialogEventHandler(FastReportSetting_CustomSaveDialog);
        FastReportSetting.CustomSaveReport += new FastReport.Design.OpenSaveReportEventHandler(FastReportSetting_CustomSaveReport);
}
// put this any where in your form , or you class
private static void FastReportSetting_CustomSaveReport(object sender, FastReport.Design.OpenSaveReportEventArgs e)
    {
        // e.Report.Save(e.FileName);
      // add your code to save report to database
    }
    private static void FastReportSetting_CustomSaveDialog(object sender, FastReport.Design.OpenSaveDialogEventArgs e)
    {
        e.Cancel = true; Â
    }
//------------------------
2) NO the saved report will not saved back to database , you need to add some code for doing that ...
Like : convert report to string, o stream , and update the database through "FastReportSetting_CustomSaveReport" function in the previous code
Comments
Try this code
use the code above before loading your report ...
Hi,
The above code disables the save and save as menu items.
But I want to disable only the " Save as " menu item.
Any ideas ?
Also I have another doubt. If I load a report from a database, modify it and then click save, will the report be saved in the respective database ?
This code will make " Save as" menu inactive ..... NOT disable
by adding a custom code , for the "save", "save as" menu
2) NO the saved report will not saved back to database , you need to add some code for doing that ...
Like : convert report to string, o stream , and update the database through "FastReportSetting_CustomSaveReport" function in the previous code
Hope this help
Thanks. I will give it a try and reply back.
One more doubt.
Is it possible to hide the code window in the designer?
(I don't want my users to alter the code or even view it.)
No, it's not possible.
Hi Alex,
That's very disappointing.
Is there any work around?