| Subject |
Re: Print receipt on pos |
| From |
Akshat Kapoor <akshat.kapoor@kapoorsons.in> |
| Date |
Sun, 4 Sep 2022 15:59:17 +0530 |
| Newsgroups |
dbase.getting-started |
| Attachment(s) |
Screenshot 2022-09-03 185853.jpg |
Good Evening Emeka,
> Thank you Akshat for usual support. What should I do to print directly to the printer.
I did a post yesterday but probably due to patchy internet (during
travel) it is not showing up.
Here it is again
Open the report in designer
In the inspector there is an option Output.
Set it to 1 Printer (Screenshot attached)
Now inspect the printer object in the inspector.
There is an option printersource.
Set it to windows default or specific printer.
If there is just 1 printer on the POS machines (and that is the default
printer) then select windows default.
If you want specific printer then you can select the printername also.
But this creates an issue at times. Suppose you select the specific
printer and that printer driver is not there on the deployment machine
then it will give errors. So it is best to leave it as empty. You can
always specify the printer name during runtime.
Save and close the report
Your report is now ready for printing
Now we move to the form.
Once you have saved the invoice and have a invoice number
(change file names and class names)
set procedure to p_sales.rep
r = new p_salesreport()
//Create a instance of report in memory
r.salesdatamodule1.sales.params["invoice"] = str(form.minvoice,10,0)
r.salesdatamodule1.sales.params["location"] = form.mlocat
r.salesdatamodule1.sales.requery()
//Set the parameters and requery
r.render()
This will print the report to the printer directly.
User will not be required to select any options.
If you want to print to a specific printer that may be different on
different computers then that requires some more steps.
Will outline those also if required. You give this a try with windows
default printer. Once it is working then we have a look at the specific
printer option.
Regards
Akshat
|

|
|