Solved

I need speed on dot matrix printers with QReport

Posted on 1998-06-11
13
513 Views
Last Modified: 2010-04-04
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
Comment
Question by:javiertb
  • 4
  • 2
  • 2
  • +5
13 Comments
 
LVL 5

Expert Comment

by:inter
ID: 1352177
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
 
LVL 2

Author Comment

by:javiertb
ID: 1352178
Adjusted points to 200
0
 

Expert Comment

by:jhun
ID: 1352179
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
 
LVL 2

Author Comment

by:javiertb
ID: 1352180
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
 
LVL 1

Expert Comment

by:pjdb
ID: 1352181
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
 

Expert Comment

by:jhun
ID: 1352182
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 2

Author Comment

by:javiertb
ID: 1352183
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
 
LVL 2

Expert Comment

by:hrizal
ID: 1352184
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
 

Accepted Solution

by:
gaona earned 200 total points
ID: 1352185
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
 
LVL 2

Author Comment

by:javiertb
ID: 1352186
Anybody heard of Report Builder or Repor Printer tools?


0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1352187
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
 
LVL 8

Expert Comment

by:ZifNab
ID: 1352188
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
 
LVL 3

Expert Comment

by:siki
ID: 2366276
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now