How can I hide reports?

Hi,

I have the next job:

ReportRun reportRun;

Args args = new Args(reportstr(‘InventJournalTransTransfer’));
InventJournalTable inventJournalTable;
PrintJobSettings printJobSettings;
;

printJobSettings = new PrintJobSettings();
printJobSettings.setTarget(PrintMedium::Printer);
printJobSettings.preferredTarget(PrintMedium::Printer);

salesFormLetter = new SalesFormLetter_Confirm(false);
salesFormLetter.updatePrinterSettingsFormLetter(printJobSettings.packPrintJobSettings());

inventJournalTable = InventJournalTable::find(‘IJ27897590’);

args.record(inventJournalTable);

reportRun = new Reportrun(args);
reportRun.init();

reportRun.printJobSettings(printJobSettings.packPrintJobSettings());
reportRun.run();


How can I hide the report “InventJournalTransTransfer” when the job is running?

I need to start the printer imediately after the job will be released, not by checking the report.

Thank you!

Sorry, I don’t understand. What do you mean by “hiding a report” and “not checking the report”? Why do you create salesFormLetter in your code snippet and don’t use it? Either something is missing or something shouldn’t be there.

Hi Martin,

I need to have the printer run after the Job is done, without checking the report.

About salesFormLetter - I removed that, I dont need this now.

Hi,

if your requirement is to send the report directly to printer, try the following code in the init() method of the report:

str printer;
showdialog = false;

printer = '\\path\To\PrinterName;
this.DeviceName(printer);
this.setTarget(printmedium::Printer);

super();

hope it helps

Regards,

Thomas

Hi

Add the follow two lines after reportun.init() :

reportRun.report().interactive(false);
reportRun.query().interactive(False);

Regards

It works!

Thanks Denis.

Great

Remember to set the post as verified solution.

Thanks