我用frxReport+frxPreview来显示报表 
代码如下
  Screen.Cursor := crHourGlass;  try
    cdsP.Close;
    cdsP.CommandText := 'Select * from sjb ';
    cdsP.Open;    if cdsP.IsEmpty then
    begin
      application.messagebox('没有数据可以显示','提示信息',MB_OK);
      Exit;
    end;
    frxReport1.LoadFromFile(AppPath + '\report\YJStat2.fr3');
    frxReport1.PrepareReport;
    frxReport1.ShowReport();
  finally
    Screen.Cursor := crDefault;
    frxPreview1.Cancel;
  end;
现在问题出现在两个方面。
1。当在统计过程中(也就是说有100页,现在到50页的时候)重新点击统计按钮,这个时候程序报错。 这种情况怎么控制。
2。当在统计过程中(也就是说有100页,现在到50页的时候)关闭了该窗体。程序自动关闭。这种情况怎么控制。