Error printing dot matrix reports

Hi;

When i am in preview of a dot matrix report, i press Ctrl + P to print the current page, and changge the number of copies to 3 or more, appears the following screen, after print the first page:

Cannot open file: %TEMPPATH%\frE8.tmp, the system could not locate the
specified file.

The filename is a random name, and the TEMPPATH is the current environment variable %TEMP%.

This only occurs when the number of copies is diferent of 1.

Thanks,

Emerson.

Comments

  • edited 8:22AM
    Correct the frxDMPExport.pas file:
    procedure TfrxDotMatrixExport.SpoolFile(const FileName: String);
    const
      BUF_SIZE = 1024;
    var
      f: TFileStream;
      buf: String;
      l: longint;
    begin
      if Report.ReportOptions.Name <> '' then
        frxPrinters.Printer.Title := Report.ReportOptions.Name else
        frxPrinters.Printer.Title := Report.FileName;
      frxPrinters.Printer.BeginRAWDoc;
    
      f := TFileStream.Create(FileName, fmOpenRead);
      SetLength(buf, BUF_SIZE);
      l := BUF_SIZE;
      while l = BUF_SIZE do
      begin
        l := f.Read(buf[1], BUF_SIZE);
        SetLength(buf, l);
        frxPrinters.Printer.WriteRAWDoc(buf);
      end;
    
      f.Free;
      frxPrinters.Printer.EndRAWDoc;
    end;
    procedure TfrxDotMatrixExport.Finish;
    var
      i: Integer;
      fname: String;
      f, ffrom: TFileStream;
    begin
      FStream.Free;
      if not frxPrinters.HasPhysicalPrinters then Exit;
    
      if not FSaveToFile then
      begin
        fname := GetTempFName;
        f := TFileStream.Create(fname, fmCreate);
        ffrom := TFileStream.Create(FileName, fmOpenRead);
        f.Write(FPrinterInitString[1], Length(FPrinterInitString));
        f.CopyFrom(ffrom, 0);
        f.Free;
        ffrom.Free;
        f := TFileStream.Create(FileName, fmCreate);
        ffrom := TFileStream.Create(fname, fmOpenRead);
        f.CopyFrom(ffrom, 0);
        f.Free;
        ffrom.Free;
        DeleteFile(fname);
        for i := 1 to FCopies do
          SpoolFile(FileName);
        DeleteFile(FileName);
      end;
    end;
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.