I linked TSrvPrint with TSRichViewEdit.
Than I call TPrintDialog, CHANGE DEFAULT PRINTER and do
SRVPrint1.Print('', PrintDialog1.Copies, PrintDialog1.Collate);
But prints ONLY occurs on the default printer.
So, I can't change the default printer by standart printer dialog.
do not change the default printer
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Sorry, I cannot reproduce this problem.
In my test, SRVPrint prints on the chosen printer.
I tested in the demo Demos\SRVPrint\PM_Auto\
Test 1
I added a new button in this demo, and assigned in its OnClick:
This demo allows choosing a printed from a combo box. When user chooses a printer, the demo assigns Printer.PrinterIndex.
Result: the demo prints on the printer chosen in the combo box, as expected.
Test 2
I placed TPrintDialog on this form, and modified the code in OnClick:
Result: the demo prints on the printer chosen in the dialog, as expected.
In my test, SRVPrint prints on the chosen printer.
I tested in the demo Demos\SRVPrint\PM_Auto\
Test 1
I added a new button in this demo, and assigned in its OnClick:
Code: Select all
SRVPrint1.Print('test', 1, False);
Result: the demo prints on the printer chosen in the combo box, as expected.
Test 2
I placed TPrintDialog on this form, and modified the code in OnClick:
Code: Select all
if PrintDialog1.Execute then begin
// we should also assign cmbPrinter.ItemIndex := Printer.PrinterIndex;
// but I did not do it to make sure that the printer is changed only by TPrintDialog
UpdateControlsForPrinter;
SRVPrint1.Print('test', 1, False);
end;