现有打印机A和打印机B。打印机A为默认。fastreport 我在设置为打印机B后,打印完成。再将打印机名称设置为Default,打算使用默认打印机进行打印,结果还是在B机器上打印,请问是什么原因?Code:FrmMain.FrRptAll.LoadFromStream(RptStream);
FrmMain.FrRptAll.PrintOptions.ShowDialog := False; case ReportID of
1 : FrmMain.FrRptAll.PrintOptions.Printer := GetBarCodePrinter;
else
FrmMain.FrRptAll.PrintOptions.Printer := 'Default';
end; FrmMain.FrRptAll.PrepareReport(True);
FrmMain.FrRptAll.Print;
FrmMain.FrRptAll.PrintOptions.ShowDialog := False; case ReportID of
1 : FrmMain.FrRptAll.PrintOptions.Printer := GetBarCodePrinter;
else
FrmMain.FrRptAll.PrintOptions.Printer := 'Default';
end; FrmMain.FrRptAll.PrepareReport(True);
FrmMain.FrRptAll.Print;
可以用一个变量记录原来的默认值。
AA:=FrmMain.FrRptAll.PrintOptions.Printer;
用完后可还原。
FrmMain.FrRptAll.PrintOptions.Printer:=AA;