Solved

I need speed on dot matrix printers with QReport

Posted on 1998-06-11
13
518 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

939 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

9 Experts available now in Live!

Get 1:1 Help Now