Solved

I need speed on dot matrix printers with QReport

Posted on 1998-06-11
13
553 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
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!

 
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

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!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month4 days, 23 hours left to enroll

635 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