Closing the Preview from code
BJL
Brussels, Belgium
Working with BCB6 and FR3
With FR version 2, I have been using successfully the following code to close the preview and allow a new one with a different dataset
However, in FR version 3, TfrxPreviewForm is not accepted as a type.
What is the equivalent in version 3 of TfrPreviewForm of the version 2?
Is there a better way to close the preview?
With FR version 2, I have been using successfully the following code to close the preview and allow a new one with a different dataset
void __fastcall TDMenu::ClosePreView(void)
{
 for (int i = frReport1->ComponentCount - 1; i >= 0; i--)
 {
  if (dynamic_cast<TfrPreviewForm*>(frReport1->Components[i]))
  {
   dynamic_cast<TForm*>(frReport1->Components[i])->Hide();
   dynamic_cast<TForm*>(frReport1->Components[i])->Close();
  }
 }
}
However, in FR version 3, TfrxPreviewForm is not accepted as a type.
What is the equivalent in version 3 of TfrPreviewForm of the version 2?
Is there a better way to close the preview?
Comments
I did include the hpp file. However the code did not work because the preview is not (no more) within the list of compnents.
BJL
TForm(frxDmxUse.Preview.Parent).Close;
in the OnAfterPrintReport event
Peter
Technisoft
frxReport1->PreviewForm->Close();