/* ----------------------------------------------------------------- Description: Altering the printer for every report on different installations is tedious. chooseprinter() offers full choice but at times speed is of essence. Get_printer.prg program captures the normally required parameters and save them to an ini file passed to it as parameter.This will save color duplex orientation papersize papersource printername Programmers: Akshat Kapoor History: 12 Feb 2019 Sharing the ready to deploy code for the first time. Instantiation/use: Just place get_printer.prg and load_ini in the required directory. get_printer("report1.ini") will save the required parameters in report1.ini (A one time event or as and when required from any form ) When running the report set procedure to report1.rep r = new report1report() load_ini("report1.ini","r.printer") will restore the required defaults. thereafter r.render() No more changing of code. with change of printer. Some Code which I am actually using set procedure to p_sales.rep r = new p_salesreport() r.salesdatamodule1.sales.params["invoice"].value = str(minvoice,10,0) r.salesdatamodule1.sales.params["location"].value = mlocat r.salesdatamodule1.sales.requery() r.title = "Invoice no. "+str(minvoice,10,0) load_ini("cashmemo.ini","r.printer") r.render() Additional requirements : Both load_ini.prg and get_printer.prg are required. They compliment each other. for Any further suggestions please email me akshatkapoor76 at gmail dot com ---------------------------------------------------------------- */ parameters file_name r = new report() if r.printer.chooseprinter() of = new file() of.create(file_name) of.writeln("color[N]"+r.printer.color) of.writeln("duplex[N]"+r.printer.duplex) of.writeln("orientation[N]"+r.printer.orientation) of.writeln("papersize[N]"+r.printer.papersize) of.writeln("papersource[N]"+r.printer.papersource) of.writeln("printername[C]"+r.printer.printername) of.close() endif