The problem is qrepots prints uses the printer driver that you
selected in the dialog box and prints it to the default
printer. So it prints garabage files on that printer. Yuck!
Is there a fix to this? I also want to hard code it so the
documents print automaticlly to the right printer to rid of
Humans "errors".
Well I'm trying to find humor in this!
Thanks
Ken
when using the printer setup, make sure that you are using
QuickRep.PrinterSetup, not the standard TPrinterSetupDialog (selecting a
printer here will be ignored by QR).
If you want to select a printer by code, use the
TQuickRep.PrinterSettings.PrinterIndex runtime property. It is an index
into Delphi's Printer.Printers stringlist of printer names.
Regards
Timo
On 28 Aug 2003 11:16:52 -0700, Ken wrote:
> ...
Thxs
Ken
here is an example for setting Quickreport's printer index by printer name:
PrinterName:='HP LaserJet 6L';
For I:=1 to Printers.Printer.Printers.Count Do
If UpperCase(Printers.Printer.Printers[I-1])=UpperCase(PrinterName) Then
begin
QuickRep1.PrinterSettings.PrinterIndex := I-1;
Break;
end;
regards
Timo
Regards
Knut
"Timo" <no_publ...@gmx.de> skrev i melding
news:jzingdu1v6fq$.11r191ii718wg.dlg@40tude.net...
> Have you also an example where you can choose an output bin, ...
the TQuickRep component has the PrinterSettings.OutputBin (and also in
3.6.2 there is PrinterSettings.CustomBinCode) property for this. Doesn't
this work for you (I currently only have a printer with a single bin
available, so I can't try)?
Regards, Timo
--
Timo.Hartmann at http://www.thsd.de
Home of QR PowerPack and QRDesign (QuickReport end user report editor)
My solution was to install an extra printer, set the property to the correct
bin here and send the report to this printer. I also found that printer
names in f.x. Windows Me have port ( on LPT :) added to their names in the
configuration (in contrast to Windows XP). Therefore I have a small table
for each report where the user kan enter margins and choose printer from a
listbox where I display awailable printers.
Regards
Knut
"Timo" <no.e...@spamhole.com> skrev i melding
news:1ekulzhttoxb1.y0gpiltalmh6$.dlg@40tude.net...
> Hi Timo
> I have made a system for a client where he wanted to fill out preprinted
> dokuments from a certain bin.
> His HP printer have other properties for this than in Quick Report. On their
> home page, qusoft.com, Questions an Answers, they admitted that this was a
> problem that they are working with.
Maybe this pice of code can solve your problem. The individual bins
for a printer are stored in a memtable and can be used f.e. in a
lookup. Wonder if this works with your printer.
procedure TQRPrinterFrm.GetPaperBins(APrinterIdx: Integer);
type
TBinName = array [0..23] of Char;
TBinNameArray = array [1..High(Integer) div SizeOf(TBinName)] of
TBinName;
PBinnameArray = ^TBinNameArray;
TBinArray = array [1..High(Integer) div SizeOf(Word)] of Word;
PBinArray = ^TBinArray;
var
Device, Driver, Port: array [0..255] of Char;
hDevMode: THandle;
i, numBinNames, numBins, temp: Integer;
pBinNames: PBinnameArray;
pBins: PBinArray;
begin
Printer.PrinterIndex := APrinterIdx;
Printer.GetPrinter(Device, Driver, Port, hDevmode);
numBinNames := WinSpool.DeviceCapabilities(Device, Port,
DC_BINNAMES, nil, nil);
numBins := WinSpool.DeviceCapabilities(Device, Port, DC_BINS,
nil, nil);
with memBin do begin
Close;
Open;
end;
if numBins <> numBinNames then
begin
raise Exception.Create('DeviceCapabilities reports different
number of bins and bin names!');
end;
if numBinNames > 0 then
begin
pBins := nil;
GetMem(pBinNames, numBinNames * SizeOf(TBinname));
GetMem(pBins, numBins * SizeOf(Word));
try
WinSpool.DeviceCapabilities(Device, Port, DC_BINNAMES,
PChar(pBinNames), nil);
WinSpool.DeviceCapabilities(Device, Port, DC_BINS, PChar(pBins),
nil);
with memBin do begin
for i := 1 to numBinNames do begin
Append;
FieldByName('Bin').AsInteger := pBins^[i];
FieldByName('BinName').AsString :=
IntToSTr(FieldByName('Bin').AsInteger) + ' - ' + pBinNames^[i];
end;
end;
finally
FreeMem(pBinNames);
if pBins <> nil then begin
FreeMem(pBins);
end;
end;
end;
end;
I will try this one.
Regards
Knut
"Hippolyt Kay" <hippol...@gmx.net> skrev i melding
news:8e16262f.03090...@posting.google.com...