// PrintDialog 이용시
procedure TFrmPreview.PrintSetupClick(Sender: TObject);
begin
with PrintDialog do
begin
Copies := 1;
FromPage := 1;
MinPage := 1;
ToPage := QRPreview.QRPrinter.PageCount;
MaxPage := QRPreview.QRPrinter.PageCount;
Options := [poPageNums, poSelection];
end;
if PrintDialog.Execute then
begin
pQuickReport.PrinterSettings.PrinterIndex := Printer.PrinterIndex;
pQuickReport.PrinterSettings.Copies := PrintDialog.Copies;
if PrintDialog.PrintRange = prAllPages then
begin
pQuickReport.PrinterSettings.FirstPage := PrintDialog.MinPage;
pQuickReport.PrinterSettings.LastPage := PrintDialog.MaxPage;
end
else if PrintDialog.PrintRange = prSelection then
begin
pQuickReport.PrinterSettings.FirstPage := QRPreview.PageNumber;
pQuickReport.PrinterSettings.LastPage := QRPreview.PageNumber;
end
else
begin
pQuickReport.PrinterSettings.FirstPage := PrintDialog.FromPage;
pQuickReport.PrinterSettings.LastPage := PrintDialog.ToPage;
end;
Application.ProcessMessages;
pQuickReport.Print;
end;
end;
// Printersetupdialog 이용시
procedure TFrmPreview.PrintSetupClick(Sender: TObject);
begin
Printersetupdialog.Execute ;
// 위에거 보구 더 수정도 해보세요... ^^
end;
// 미리보기 폼을 가지고 사용한 것 입니다.
// PrintDialog 이용시
procedure TFrmPreview.PrintSetupClick(Sender: TObject);
begin
with PrintDialog do
begin
Copies := 1;
FromPage := 1;
MinPage := 1;
ToPage := QRPreview.QRPrinter.PageCount;
MaxPage := QRPreview.QRPrinter.PageCount;
Options := [poPageNums, poSelection];
end;
if PrintDialog.Execute then
begin
pQuickReport.PrinterSettings.PrinterIndex := Printer.PrinterIndex;
pQuickReport.PrinterSettings.Copies := PrintDialog.Copies;
if PrintDialog.PrintRange = prAllPages then
begin
pQuickReport.PrinterSettings.FirstPage := PrintDialog.MinPage;
pQuickReport.PrinterSettings.LastPage := PrintDialog.MaxPage;
end
else if PrintDialog.PrintRange = prSelection then
begin
pQuickReport.PrinterSettings.FirstPage := QRPreview.PageNumber;
pQuickReport.PrinterSettings.LastPage := QRPreview.PageNumber;
end
else
begin
pQuickReport.PrinterSettings.FirstPage := PrintDialog.FromPage;
pQuickReport.PrinterSettings.LastPage := PrintDialog.ToPage;
end;
Application.ProcessMessages;
pQuickReport.Print;
end;
end;
// Printersetupdialog 이용시
procedure TFrmPreview.PrintSetupClick(Sender: TObject);
begin
Printersetupdialog.Execute ;
// 위에거 보구 더 수정도 해보세요... ^^
end;
자세한건 Q&A를 더 찾아보면 많은 정보를 얻을 수 있습니다.