Home > Back-end >  Fastreport problems setting up the printer
Fastreport problems setting up the printer

Time:10-11

Existing printers and printer B, A is the default printer,

B after fastreport I am set to printer to print out, then set the printer name as the Default, intends to use the Default printer for printing, the result or print on B machine, what reason be excuse me?

Code:

FrmMain. FrRptAll. LoadFromStream (RptStream);
FrmMain. FrRptAll. PrintOptions. ShowDialog:=False;

Case ReportID of
1: FrmMain. FrRptAll. PrintOptions. Printer:=GetBarCodePrinter;
The else
FrmMain. FrRptAll. PrintOptions. Printer:='Default';
end;

FrmMain. FrRptAll. PrepareReport (True);
FrmMain. FrRptAll. Print;

CodePudding user response:

FrmMain. FrRptAll. PrintOptions. Printer:='Default';//this statement is not correct, it is only a printer list,
Can use the default value of a variable records the original,
AA:=FrmMain FrRptAll. PrintOptions. Printer;
After use can restore,
FrmMain. FrRptAll. PrintOptions. Printer:=AA;
  • Related