Главная страница | назад





Article #17998: No default printer selected when using Quickreports

 Question and Answer Database
FAQ2998D.txt — No default printer selected when using Quickreports
Category :Quick Reports
Platform :All-32Bit
Product :
Question:
I get a exception error when running our application on a
machine without a default printer.
Answer:
QuickReport requires that a default printer be installed. The
report is prepared using information from the printer driver.
The following code is one way to check and see if a default
printer has been defined.
procedure TForm1.Button1Click(Sender: TObject);
var
Device, Driver, Port : array [0..255] of Char;
Mode : Integer;
begin
Printer.GetPrinter(Device,Driver,Port,Mode);
if Device <> '' then
ShowMessage(Device)
else
ShowMessage('You do not have a default printer defined');
end;
4/2/99 12:18:51 PM

Last Modified: 01-SEP-99