Application Error when frequently switch to show report

edited April 2009 in FastReport 4.0
Hi,Friend
I created two nodes to show the report,detail informaiton as below:
Node 1: Show report based on "a.fr3";
Node 2: Show report based on "b.fr3";

Way is:
frxReport1->LoadFromFile(fFrFile);
frxReport1->ShowReport(true);
or
frxReport1->LoadFromFile(fFrFile);
frxReport1->PrepareReport(true);
frxReport1->ShowPreparedReport();

if I frequently and quickly click or switch node to show the different report between two nodes, sometime it will encounter error.

How to avoid and solve this problem?

br

Johnny

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 11:15PM
    why the call to frxreport2
  • edited April 2009
    gordk wrote: »
    why the call to frxreport2

    Sorry,Copy error
    frxReport1->LoadFromFile(fFrFile);
    frxReport1->PrepareReport(true);
    frxReport1->ShowPreparedReport();

    br

    Johnny
  • edited 11:15PM
    hi,all

    Anybody know how to fix this problem,it's urgent for me!

    br

    Johnny
  • gordkgordk St.Catherines On. Canada.
    edited 11:15PM
    make sure the report component modal property is true;
    you are creating the problem by moving from one node to the other when calling preparereport.
    it probably has not finished when you jump out.
    try calling clear report before loading, 2 once you enter a node disable the other node until you have finished work in the active node.
  • edited April 2009
    Dear Gord

    Thanks for your reply,please refer following code for your reference!

    I have cleared it before loading fr3 file,please check my relevant code:

    void __fastcall TForm1::ListView1Click(TObject *Sender)
    {
    frxReport1->Clear();
    int iIndex = ListView1->ItemIndex;
    String fFrFile= "D:\\vCPlusPlus\\doctest" + IntToStr(iIndex) + ".fr3";
    frxReport1->LoadFromFile(fFrFile);
    if (frxReport1->PrepareReport(true))
    {
    frxReport1->Preview;
    }
    }

    please share your good ideas to fix it!

    Thanks a lot!

    Johnny

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.