Heavy Bug with custom Previews

edited 12:34PM in FastReport 3.0
As long as I use the build-in preview, everything works fine, but If I use the preview-component, show a report, start the designer in runtime mode AND creating a preview (CTRL-P), I've got an AV after returning to the main form containing the preview-comp with:

exception class : EAccessViolation
exception message : Zugriffsverletzung bei Adresse 00404048 in Modul 'Project1.exe'. Lesen von Adresse 0000000A.

main thread ($240):
00404048 Project1.exe System @IsClass
00523227 Project1.exe frxPreview 1595 TfrxPreview.OnMessage
00566b6c Project1.exe frxClass 7085 TfrxCustomPreviewPages.SetMessageText
0052b6d9 Project1.exe frxPreviewPages 1514 TfrxPreviewPages.ObjectOver
00521132 Project1.exe frxPreview 733 TfrxPreviewWorkspace.MouseMove
004a04f2 Project1.exe Controls TControl.WMMouseMove
0049ffdc Project1.exe Controls TControl.WndProc
004a303b Project1.exe Controls TWinControl.WndProc
004b9751 Project1.exe Forms TCustomForm.WndProc
0049fdac Project1.exe Controls TControl.Perform
004a0911 Project1.exe Controls TControl.CMMouseEnter
0049ffdc Project1.exe Controls TControl.WndProc
004a303b Project1.exe Controls TWinControl.WndProc
004a2cb8 Project1.exe Controls TWinControl.MainWndProc
0044ce0c Project1.exe Classes StdWndProc


This error seems only to occur if I create a preview (CTRL-P) in the runtime-designer!

Please help - it's a show stopper and I need to finish my project (including the reports 8-)

Comments

  • edited 12:34PM
    I experience the same. In FR2.5 I had to turn off some global boolean to be able to use the designer at all with a preview existing. In FR2 I also had to turn of preview in the designer options (you can do that).

    I did this in FR3 to make it work "better". Its not 100%, especielly when you have expression errors in the report.
           //  Turn off/on some thisng that don't work great in the designer
          frxReport1.Preview := nil;
          frxReport1.PreviewOptions.MDIChild := false;
          frxReport1.PreviewOptions.Modal := true;
          frxReport1.EngineOptions.SilentMode := false;
          SaveOnAfterPrint := frxReport1.OnAfterPrint;
          frxReport1.OnAfterPrint := nil;
    
            //  Register design save function
          MainForm.frxDesigner1.OnSaveReport := frxDesigner1SaveReport;
          MainForm.frxDesigner1.OnLoadReport := frxDesigner1LoadReport;
          try
            revertStream.Clear;
            frxReport1.SaveToStream(revertStream);
            frxReport1.DesignReport;
          finally
              //  Turn then back on/off
            frxReport1.Preview := frxPreview1;
            frxReport1.PreviewOptions.MDIChild := true;
            frxReport1.PreviewOptions.Modal := false;
            frxReport1.EngineOptions.SilentMode := true;
            frxReport1.OnAfterPrint := SaveOnAfterPrint;
            MainForm.frxDesigner1.OnSaveReport := nil;
            MainForm.frxDesigner1.OnLoadReport := nil;
          end;
    

    I have some problems with the designer disappearing (since its a modal window with its own mainform, user has to click app in the taskbar, Alt+Tab is not enogh). If you find a solution for this, post it, thanks.

    Hope this helps.

    /Dany
  • edited 12:34PM
    Thx!

    I'll try that out. I'll also move this topic to the newsgroup - maybe it could be fixed by Alex.

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.