Direct to Printer?
Hi Guys,
Using the following...
MyExplorer.LoadReport('Test Report', 0);
MyReport.Print;
How do i get the report to go directly to the printer rather than via the
print preview dialog?
I have set the MyReport DeviceType property to Printer but it didn't make any
difference.
Regards & TIA,
Ian
--
Using the following...
MyExplorer.LoadReport('Test Report', 0);
MyReport.Print;
How do i get the report to go directly to the printer rather than via the
print preview dialog?
I have set the MyReport DeviceType property to Printer but it didn't make any
difference.
Regards & TIA,
Ian
--
This discussion has been closed.
Comments
Set the ShowPrintDialog property of your ppReport to false
HTH
Arno
--
Hi Arno,
It wasn't set at design time and just to be sure I set it to false at run time
and I still get the dialog.
Regards,
Ian
--
well.
MyExplorer.LoadReport('Test Report', 0);
MyReport.ShowPrintDialog := False;
MyReport.DeviceType := 'Printer'
MyReport.Print;
Regards,
Ian
--
Correct. The report definition saves/restores the published properties of
the report. So you need to first load the report definition and then set the
properties.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Hi Nard,
Thanks for the validation.
OK. Next step.
Same report, has a DataPipeline called Invoice. Invoice has a Search Criteria
of invnumb = 10.
Once the report is loaded via this means, how/where do I change the search
criteria to say invnumb = 20, before printing?
Regards & TIA,
Ian
--
procedure TForm4.MyReportGetAutoSearchValues(Sender: TObject);
begin
if (MyReport.AutoSearchFieldCount = 0) then Exit;
if (MyReport.AutoSearchFields[0].FieldName = 'Invnumb') then
MyReport.AutoSearchFields[0].SearchExpression := '20';
end;
But it keeps popping up the search dialoge, and puts the existing
'searchexpression, 10, in the dialog. Yes I can change it and it works however
I need it to simply accept the 20 and continue without the dialog.
Regards,
Ian
--
the field name needs to be of the same case as that in the report.
"MyReport.AutoSearchFields[0].FieldName = 'INVNUMB'" 'Invnumb' wouldn't work.
Ian
--
// load the report
MyExplorer.LoadReport('Test Report', 0);
// configure the report
MyReport.ShowPrintDialog := False;
myReport.ShowAutoSearchDialog := False;
if (MyReport.AutoSearchFieldCount > 0) then
if (MyReport.AutoSearchFields[0].FieldName = 'INVNUMB') then
MyReport.AutoSearchFields[0].SearchExpression := '20';
// print
MyReport.DeviceType := 'Printer'
MyReport.Print;
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com