Microsoft Dynamics GP Developing for Dynamics GP
A blog dedicated to the Microsoft Dynamics GP Developer & Consultant community
 
Welcome to MSDN Blogs Sign in | Join | Help

Developing for Dynamics GP

by David Musgrave (Australia) and the Microsoft Dynamics GP Developer Support Team (USA)

News

  • Please use the Blog Feedback? - Contact Us link at the top of the page to email questions relating to the blog itself.

    If you wish to ask a technical question, please use the links below to ask on the Newsgroups. If you ask on the Newsgroups, others in the community can respond and the answers are available for everyone in the future.

    Please do not use comments on pages and posts to ask questions unrelated to the topic on that page or post.



    Dates of Interest:

    11-Jul-2008: Blog Created by David Musgrave.
    10-Oct-2008: First Post by Scott Stephenson.
    04-Nov-2008: First Post by Dave Dusek.
    11-Nov-2008: First Post by Beth Gardner.
    28-Nov-2008: First Post by Chris Roehrich.
    30-Dec-2008: First Post by Patrick Roth.
    24-Feb-2009: First Post by Greg Willson.
    22-Apr-2009: First Post by David Clauson.
    04-May-2009: First Post by Ryan Wigestrand.
    19-Jun-2009: First Post by Dawn Langlie.
    03-Jul-2009: First Post by Emily Halvorson.
    23-Sep-2009: Created Twitter account with blog feed.



    WorldMaps Statistics since
    24-Feb-2009:




    Click for WorldMaps Stumbler



    Translator Tool:




    Social Networking

    Follow David Musgrave and the blog on:

    David Musgrave on Twitter

    David Musgrave on LinkedIn


    Disclaimer

    This blog is provided "AS IS" with no warranties, and confers no rights.

    The links in this blog may lead to third-party Web sites. Microsoft provides third-party resources to help you find customer service and/or technical support resources. Information at these sites may change without notice. Microsoft is not responsible for the content at any third-party Web sites and does not guarantee the accuracy of third-party information.

Contents

Favourite Posts

Blog Links

Newsgroups Links

Resources Links

Hybrid - Adding Named Printers control to Reports using VBA

Named Printers is a module to allow controlling of the printer and settings used when printing reports.  It was originally developed for v3.00 by me while I was working for Sequel Technology (that's why the tables and calls are prefixed with ST).  Later it was purchased by Great Plains for v5.50 and included in core code (Dynamics.dic) for v6.00 onwards.

Named Printers works for any report that is set up to call Named Printers, but what happens when you want Named Printers control for a report that is currently not supported... Well, you can use VBA to call the appropriate Dexterity sanScript functions via the Continuum Integration Library to add a new Named Printers Task to the Assign Named Printers window.  Then the code can read the setting for that Task and change the application default printer just before the report is printed.  After the report is printed, the correct default printer is restored using the System Default and Company Default printers.  The Company Default printer takes precedence if one is set up.

This example adds Named Printer control when printing from the Inventory Transaction Inquiry window when using the window print button. The code is configured so that the Printer Task is only available from the Assign Named Printers window while the Inquiry window is open.  When the window is closed the Printer Task is removed and the settings selected are removed.  To make the settings permanent, you will need to comment out the "clean up" script when the window is closed. 

NOTE: This customisation uses a method of executing Dexterity sanScript code from VBA which is unsupported by Microsoft.

Example code for v8.0, v9.0 & v10.0 is attached at the bottom of the article.

Please see the "Installation Instructions.txt" file in each version's archive for more information.

Posted: Wednesday, January 14, 2009 10:30 AM by David Musgrave
Attachment(s): Named Printer Control.zip
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker