Application Error when frequently switch to show report
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
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
Sorry,Copy error
frxReport1->LoadFromFile(fFrFile);
frxReport1->PrepareReport(true);
frxReport1->ShowPreparedReport();
br
Johnny
Anybody know how to fix this problem,it's urgent for me!
br
Johnny
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.
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