Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 580
  • Last Modified:

I need speed on dot matrix printers with QReport

I'm using Qreport and Delphi 3 to list large amounts of data but my client uses dot matrix printers because they're faster, or at least they were faster in DOS.
How can I print QReports using the same fast font and draft quality as in DOS??  The printers are Epson LX-300 and OKI ML3390.

Thanks in advance
0
javiertb
Asked:
javiertb
  • 4
  • 2
  • 2
  • +5
1 Solution
 
interCommented:
Hi,
I am sorry but as far as I know the QR components reder the report on HDC which means it finally produces an image. So there may be no way to do it with QR components and bypass the Device Context rendering.
Regards, Igor
0
 
javiertbAuthor Commented:
Adjusted points to 200
0
 
jhunCommented:
In QR save youre report as a text file, and next copy the text file with a PASSTHROUGH command to the printer. Then you have the speed of printing back. Remember you cannot do any fancy thing in youre report, so no lines, images different fonts etc. The code for passthrough is dependend of with OS you are using, but some good samples can be found in the ti's of Borland.

Gr. John


0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
javiertbAuthor Commented:
I'm using Windos NT 4.0 as well as Windows 95. Could you show me an example using this function under these environments?
And also, if there's no way of using QReport for direct txt printing, which reporting tool do you think is the best for Delphi, capable of printing with dot-matrix printers as well as the ink-jet ones?
0
 
pjdbCommented:
You can print with the old DOS system : open a file named LPT1 (parallell port 1) with the reset command then put all your stuff just like to an ASCII/ANSI file and then close it.

JDB
0
 
jhunCommented:
Here some code for passthroug printing. (Borland TI 3196)

unit Esc1;

interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{ add the printers unit }
uses
   Printers;

{$R *.DFM}

{ declare the "PASSTHROUGH" structure }
type TPrnBuffRec = record
  BuffLength : word;
  Buffer : array [0..255] of char;
end;


procedure TForm1.Button1Click(Sender: TObject);
var
  Buff : TPrnBuffRec;
  TestInt : integer;
  s : string;
begin

{ Test to see if the "PASSTHROUGH" escape is supported }
  TestInt := PASSTHROUGH;
  if Escape(Printer.Handle,
            QUERYESCSUPPORT,
            sizeof(TestInt),
            @TestInt,
            nil) > 0 then begin

  { Start the printout }
    Printer.BeginDoc;

  { Make a string to passthrough }
    s := ' A Test String ';
  { here you open your file and feed it to the buffer !}

  { Copy the string to the buffer }
    StrPCopy(Buff.Buffer, s);

  { Set the buffer length }
    Buff.BuffLength := StrLen(Buff.Buffer);

  { Make the escape}
    Escape(Printer.Canvas.Handle,
           PASSTHROUGH,
           0,
           @Buff,
           nil);

  { End the printout }
    Printer.EndDoc;
  end;
end;

end.

Gr. John
0
 
javiertbAuthor Commented:
If that's the only way of doing it then it's no useful for me.
I will increase again to 200 points if someone one finds any other way of doing it by using QuickReport, otherwise I'll give just 50 points for any good advice on a reporting tool capable of printing using dot-matrix printers with high speed.
0
 
hrizalCommented:
no ... no other way, when ever you increase to 10000 point maybe.
Quick Report using windows routines to produce report, it means
true graphic.

the fast (faster maybe), if only using sending character direct
to the printer port (LPT), as PJDB said or JHUN.

u' can use escape code to make fancy printout (italic/condensed/emphasize ... etc)

try this simple procedure

//=========================================
Procedure PrintDraft(TS : TStringList);
var p : textfile;
begin
  assignfile(p,'LPT1');
  rewrite(p)
  for i := 1 to TS.Count -1 do writeln(p,s);
  close(p);
end;
//=========================================

// for example, content of memo will be print
begin
  PrintDraft(Memo1.Lines);
end.



0
 
gaonaCommented:
Unhappily, being used Quick Report, that is impossible.  
A called component exists TBPrint.shovels, created by HorĂ¡cio Jamilis (jhoracio@cvtci.com.ar).  
this is the component that takes care of the communication with the printer or the Windows printer driver. You could send a couple of text lines for printing and this component will take care that this be on the paper in the way you want.
0
 
javiertbAuthor Commented:
Anybody heard of Report Builder or Repor Printer tools?


0
 
ZifNabCommented:
Hi javierb,

I 've got a great report/preview  printing tool. It's also freeware, but I don't now if it will work for your needs, you've to try it yourself.

PS. I can only send it to you by email because I totally lost this url...

Zif.
0
 
ZifNabCommented:
Yeck, yeck, was browsing around and guess what I found it again.
In torries!

torry.rimini.com/vcl/print/pageprnt.zip

and I found one for DOS and windows printing :

torry.rimini.com/vcl/print/tbprint.zip

Sorry, don't know how to implement such printing in QR.

Zif.
0
 
sikiCommented:
Ok, let's kill your troubles. This is not exactly what you are looking for, but it works fine with me!
You can fint it in Torries.
www.torry.ru => look for archive
Zreport. This is WYSIWYG comp. pack like
QReport, but for dot matrix printers!
And with source!!! You will find all comps like in QR, (without graphics ones).
This pack have no more support (i think). If anybody want's to make this
comps better, please, let me know.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 4
  • 2
  • 2
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now