Solved

I need speed on dot matrix printers with QReport

Posted on 1998-06-11
13
543 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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!

 
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
 
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

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!

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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