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

15 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
  8. Merely a smiling visitant here to share the love (:, btw outstanding style. T-Shirt Printer

    ReplyDelete
  9. It offers benefits that promptly produce print results as well as more critically, it gives imaginative printing arrangements redid to the customers' needs.Galleria on 3rd

    ReplyDelete
  10. Inkjet ink is uncommonly detailed for explicit printer models and their motivation, much innovation is engaged with the advancement of these inks to improve print quality, life span, drying rates and printing speeds and so on.cartucce compatibili

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. I actually relish this text, revealed your site on bing and check a couple of your primary posts. Still stick with it the superb operate. 123 hp com setup 6950

    ReplyDelete
  14. I have read all the comments and suggestions posted by the visitors for this article are very fine,We will wait for your next article so only.Thanks! הדפסה על כוס זכוכית

    ReplyDelete
  15. It is a great website.. The Design looks very good.. Keep working like that!. הדפסה על כוסות

    ReplyDelete