Axaptapedia is now maintained by AgileCadence For more information please click here.

Report printer settings

From Axaptapedia
Jump to: navigation, search

Use PrintJobSettings class for this


Choose a Printer Tray[edit]

The PrintJobSettings Object allows you to choose from which tray to print. First ask for the Number of trays on the printer. Notice that the returned value may not correspond to reality. It may be much bigger than the number of trays on the printer itself. Once it returned 20 for a printer with 3 trays. <xpp> int trayNums = settings.getNumberOfTrays(); </xpp>

Next step is try and error. Open each tray on the printer and write the number on some sheet of papers. Than you have to try what Tray ID corresponds to which tray.

<xpp> Args args; ReportRun reportRun; PrintJobSettings settings; int trayId;

args = new Args(); args.name(reportStr(MyDummyReport));

reportRun = new ReportRun(args); settings = reportRun.printJobSettings(); settings.clearTrayPageCopy(); trayId = settings.getTray(1); // maybe 261, etc. settings.addTrayPageCopy(trayId,1); // try from 1 .. getNumberOfTrays() reportRun.run(); </xpp>

Check out what trayID value leads to what printing behaviour. Now store the (trayID | real tray number) pair in a paramter table or further use. If the printer is exchanged make sure that your ID |Tray pairs still fit.