My apologies for posting this here, but I posted to [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>  at 13:44 and still haven't seen my posting
come through...

I have asked this same question on the
borland.public.delphi.reporting-charting newsgroup, but have not had any
response so hope that someone here can help.

When user changes something from the Printer Setup button on the QuickReport
Preview screen (e.g. Print from page 1 to page 2) and then prints the report
from the Preview screen, it prints one page and then completely freezes the
computer (requires ctrl-alt-del to escape).  The Print Progress dialog shows
that it freezes at 49%.  But if the user just chooses to print without
changing the Printer Setup, it prints the whole report fine.

The code below is rather messy (full of try/except, try/finally as we were
trying to trap what was going wrong).  Does anyone out there have any
suggestions???

procedure TfrmReportSelection.doGrossProfitReport;
begin

  try

    try

      Screen.Cursor := crHourGlass;
      try
        frmGrossProfit := TfrmGrossProfit.Create(Application);
        with frmGrossProfit do begin

          Screen.Cursor := crDefault;
          Application.ProcessMessages;
          rptGrossProfit.Prepare;

          try

            with rptGrossProfit.QRPrinter.Create do begin
              PrinterIndex := -1;
              rptGrossProfit.Page.PaperSize := PaperSize;
              rptGrossProfit.PrinterSettings.OutputBin := OutputBin;
            end;

            rptGrossProfit.PreviewModal;
            Close;

          finally

            rptGrossProfit.QRPrinter.Free;
            
          end;
          rptGrossProfit.QRPrinter := nil;
        end;
      finally
        frmGrossProfit.Free;

      end;

    except
      on E: Exception do
      ShowMessage(E.Message);

    end;

  finally

    Screen.Cursor := crDefault;

  end;

end;


TIA,
Michael

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to