EnvironmentSettings.CustomSaveReport event

edited 4:05AM in FastReport .NET
FastReport 1.8.43 demo version

Hello,

I try to use this event to store the report into a database. Its working so far, but I noticed, that the event is fired several time. Sometimes 2x, sometimes more. What could be the reason for this behavior? I assigned a custom ReportDesigner control to the report control.


With best regards - Ulrich Groffy

Comments

  • edited 4:05AM
    Hello,

    It should be fired each time when you save the report (or "save as..."). I've checked it in the Demos\C#\CustomOpenSaveDialogs, it works as expected.
  • edited 4:05AM
    Hello Alex,

    you are right its working as expected. The reason is, that I try to open more than one instance of the ReportDesigner at same time. I do create an EnvironmentSettings each time as well, but this seems to bring the problems. If I hook into the Designer.cmdSave.CustomAction, and not using the EnvironmentSettings.CustomSaveReport event its working.

    By the way - what is the difference between

    - EnvironmentSettings.CustomSaveReport

    and

    - EnvironmentSettings.DesignerSettings.CustomSaveReport

    ?



    Best regards - Ulrich

    AlexTZ wrote: »
    Hello,

    It should be fired each time when you save the report (or "save as..."). I've checked it in the Demos\C#\CustomOpenSaveDialogs, it works as expected.
  • edited 4:05AM
    There is no difference, both are mapped to a global object - FastReport.Utils.Config.DesignerSettings. You may access it via code instead of using EnvironmentSettings component.
  • edited June 2012
    Hello Alex,

    actually I'm using the Designer.cmdSave.CustomAction event for saving the report into a database. I noticed, that the save button is still active after executing the saving. Is there any flag I can set to disable the save button again?

    Another question is, is there a designer close event, I can use to save the designer settings. There is no filename property for the designer configuration file. Where do the designer control store the settings when executing designer.SaveConfig() method?


    With best regards - Ulrich Groffy


    AlexTZ wrote: »
    There is no difference, both are mapped to a global object - FastReport.Utils.Config.DesignerSettings. You may access it via code instead of using EnvironmentSettings component.
  • edited 4:05AM
    It's not recommended to use custom action for save. If possible, use the FastReport.Utils.Config.DesignerSettings.CustomSaveDialog/CustomSaveReport events.
  • edited 4:05AM
    Hello Alex,

    at the moment i have the same problem as Groffy... we also use more than one instance of the
    report designer in your application.

    If i press the save button in a designer window, the save dialog pops up again and again as much as instances of the designer are running.

               
    _environmentSettings = new EnvironmentSettings();
    _environmentSettings.UseOffice2007Form = false;
    _environmentSettings.UIStyle = UIStyle.VisualStudio2005;
                
    _environmentSettings.DatabaseLogin += EnvironmentSettings_DatabaseLogin;
    _environmentSettings.AfterDatabaseLogin += EnvironmentSettings_AfterDatabaseLogin;
    
    _environmentSettings.CustomOpenDialog += DesignerSettings_CustomOpenDialog;
    _environmentSettings.CustomOpenReport += DesignerSettings_CustomOpenReport;
    _environmentSettings.CustomSaveDialog += DesignerSettings_CustomSaveDialog;
    _environmentSettings.CustomSaveReport += DesignerSettings_CustomSaveReport;
    

    How can i handle this events separatly for every instance so that i can get rid of this problem?


    Thanks in advance,
    Markus Lax

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.