Get printer name from report when it was saved
Hi,
For this issue I am using RB19.02 and Delphi 10.1 Berlin.
As an addition to a win32 ERP system, I developed a web application in Intraweb. The web application is used in a production facility where people are equipped with a tablet or phone that is connected to the LAN by Wi-Fi. One of the functions is to print a package list. The user presses a button on the tablet and the server prints the package list to a network attached printer.
All printers are installed on a server and shared for the other computers in the company. The printer name is saved in the report as \\servername\printername. This works well for the ERP system.
What I now see in the Intraweb service (that runs on the server) is that when the report is loaded, TppReport.Printer.PrinterName resets to Default. Reason is probably because on the server the name of the printer is printername without the \\servername\ prefix.
I would like to map the printer names in the report to printer names known by the server but it seems the printername changes to Default immediate after loading the report. Is it possible to get hold of the printername in the report when saved?
For this issue I am using RB19.02 and Delphi 10.1 Berlin.
As an addition to a win32 ERP system, I developed a web application in Intraweb. The web application is used in a production facility where people are equipped with a tablet or phone that is connected to the LAN by Wi-Fi. One of the functions is to print a package list. The user presses a button on the tablet and the server prints the package list to a network attached printer.
All printers are installed on a server and shared for the other computers in the company. The printer name is saved in the report as \\servername\printername. This works well for the ERP system.
What I now see in the Intraweb service (that runs on the server) is that when the report is loaded, TppReport.Printer.PrinterName resets to Default. Reason is probably because on the server the name of the printer is printername without the \\servername\ prefix.
I would like to map the printer names in the report to printer names known by the server but it seems the printername changes to Default immediate after loading the report. Is it possible to get hold of the printername in the report when saved?
Kind regards,
Jeroen Röttink
JR-soft software solutions
Jeroen Röttink
JR-soft software solutions
Comments
Here are some options:
1. Typically a web application will generate reports to PDF and return to mobile device. The mobile device can print to the printer. This is the solution we use for the REST service and mobile client components included with RB Enterprise.
2. If you prefer for the server to print, you can store custom information with templates using the Report.Template.OnSaveEnd/OnLoadEvent events. The ReportExplorer uses this technique, you just need to add the field(s) to the rbItem table and implement the event-handlers. For .rtm files its possible to store custom info in an offset area at the front of the stream, details here.
http://rbwiki.digital-metaphors.com/design/templates/how-to-store-information-with-my-report-template/
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Thanks for the info.
1. The users also have the option to generate a PDF document but it is cumbersome to generate a pdf and use the pdf reader and print functionality of the tablet to print the document to paper. That's why we choose this option for sessions from the production facility.
2. Didn't think of that option. In the meantime we choose the option that the employee can pick the printer from a list of available printers. The chosen printer wil be the default for the report, employee combination in the future.
Jeroen Röttink
JR-soft software solutions