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");
}

7 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
  4. Floor Graphics can be utilized as a part of substantial activity regions, for example, healing centers, workplaces and shopping centers.postcards printing

    ReplyDelete
  5. Many thanks. soo good job about 3d
    https://www.3dprintingio.com/

    ReplyDelete
  6. Versatile, affordable printers are the best choices here, and inkjets usually satisfy the printing needs of most home users looking to output photos from their digital camera or for other light printing needs. cheap 3d printer

    ReplyDelete
  7. At first the majority of the yields were just in dark; yet bit by bit color printers have developed and are utilized in incredible numbers these days.best wireless printer

    ReplyDelete