Pages

Tuesday, August 12, 2014

How to get/set printer settings in AX 2012 for SRS reports

This is a simple job that shows you how to get/set printer settings in AX 2012.  In AX 2009, I used things like PrintJobSettings and SysPrintForm where in AX 2012 you use SRSPrintDestinationSettings which uses SysOperationsTemplateForm.

This is just a "Hello World" if you will for modifying the print settings in AX 2012 and I'll be posting a follow up with a slightly more advanced example.


static void GetPrinterSettingsAX2012Simple(Args _args)
{
    SRSPrintDestinationSettings             printSettings = new SRSPrintDestinationSettings();
    SRSPrintDestinationSettingsContainer    printerNameDestination;
    
    // This sets what the user will see defaulted
    printSettings.printMediumType(SRSPrintMediumType::Printer);
    
    if (SrsReportRunUtil::showSettingsDialog(printSettings))
    {
        printerNameDestination = SrsReportRunUtil::getPrinterNameDestination(printSettings);
        
        if (printerNameDestination != conNull())
        {
            info(strFmt("Printer Name: %1", conPeek(printerNameDestination, 1))); 
            info(strFmt("Printer Destination: %1", conPeek(printerNameDestination, 2)));
        }
    }
    else
        info("User clicked cancel");
}

3 comments:

  1. Many thanks. At last something simple and definitive

    ReplyDelete
  2. As the name suggests, broadly useful printers can be utilized for printing nearly anything, including content and photographs. Pick a general printer with a laser arrange in the event that you print more content than photographs; and pick an inkjet design in the event that you print more photographs than content.szkolenia 3d

    ReplyDelete
  3. For the individuals who need to grow the market printing administration, the Web to Printing framework is the most critical.Large organize publications, envelopes, business cards are for the most part accessible in system to printing administrations.best budget 3d printer

    ReplyDelete