Code example for print formletter report

Hello,

I have a simple AX2009 script for print salesformletter to an PDF file. Now I want to migrate the script to AX2012. Now the Problem I have, that the printsettings will not be used. The Report will print to screen, not to file how I need. I think, the Problem is the handling in formLetterController.

printsettings by using formLetter handling?

Here an excerpt from any code example for print salespackingslip:

printSettings = new SRSPrintDestinationSettings(_salesFormLetter.printerSettingsFormletter(PrintSetupOriginalCopy::Original));

printSettings.fileFormat(SRSReportFileFormat::PDF);
printSettings.printMediumType(SRSPrintMediumType::File);
printSettings.fileName(filePath+fileName); //any path and filename

salesPackingSlipMenu = new MenuFunction(menuitemoutputstr(salesPackingSlipOriginal),MenuItemType::Output);
_salesFormLetter.usePrintManagement(false);
_salesFormLetter.updatePrinterSettingsFormLetter(printSettings.pack(),PrintSetupOriginalCopy::Original);

parameters.caller(_salesFormLetter);
parameters.record(_packingSlipJour);
salesPackingSlipMenu.run(parameters);

Thanks and regards

Ina

Hello,

I could solve the problem by changing the class SrsPrintMgmtFormLetterController.

regards Ina