Parent of TFrxReport.Print() Progress Bar
My application needs to print a TFrxReport silently. It does this as follows:
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->
frxReport1->PrintOptions->ShowDialog = false;
frxReport1->PrepareReport();
frxReport1->Print();
<!--fontc--></span><!--/fontc-->
Unfortunately, the progress window that appears has it's parent set to Application.MainForm, rather than Screen.ActiveForm, which is what I would expect. This means that when the progress window appears it drags the Application.MainForm window from the background and puts it over top of the the Screen.ActiveForm window.
If I suppress the progress window with <!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->frxReport1->ShowProgress = true;<!--fontc--></span><!--/fontc--> the problem does not occur, but this is not acceptable - I need the progress window to appear.
Interestingly, if I show the print options dialog with <!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->frxReport1->PrintOptions->ShowDialog = true;<!--fontc--></span><!--/fontc-->, that dialog uses the Screen.ActiveForm window as its parent, so TFrxReport.Print() is aware of Screen.ActiveForm.
This seems like a bug to me. TFrxReport.Print() should consistently use Screen.ActiveForm as its parent.
Does anyone know how to get around this problem? I.e. is there anyway to explicitly set the Parent of the progress window?
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->
frxReport1->PrintOptions->ShowDialog = false;
frxReport1->PrepareReport();
frxReport1->Print();
<!--fontc--></span><!--/fontc-->
Unfortunately, the progress window that appears has it's parent set to Application.MainForm, rather than Screen.ActiveForm, which is what I would expect. This means that when the progress window appears it drags the Application.MainForm window from the background and puts it over top of the the Screen.ActiveForm window.
If I suppress the progress window with <!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->frxReport1->ShowProgress = true;<!--fontc--></span><!--/fontc--> the problem does not occur, but this is not acceptable - I need the progress window to appear.
Interestingly, if I show the print options dialog with <!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->frxReport1->PrintOptions->ShowDialog = true;<!--fontc--></span><!--/fontc-->, that dialog uses the Screen.ActiveForm window as its parent, so TFrxReport.Print() is aware of Screen.ActiveForm.
This seems like a bug to me. TFrxReport.Print() should consistently use Screen.ActiveForm as its parent.
Does anyone know how to get around this problem? I.e. is there anyway to explicitly set the Parent of the progress window?
Comments