Share via


Automating or Customizing the Report Destination Window

David Meego - Click for blog homepageI have seen this issue come up a number of times.  Trying to automate processes which involve reports and wanting to automate the Report Destination window.  Sometimes you can add the Report Destination to Visual Basic for Applications (VBA) and sometimes the system will not add the window to VBA.  This post will explain the reason for this "weird" behavior.

One thing about "weird" behavior when it comes to computers, is that once the explanation has been discovered, it all makes perfect sense and the computer is just being logical.

The primary fact for this issue is that there are actually two different Report Destination windows:

  1. In the Dex.dic. This Report Destination window is part of the runtime engine and is opened when a report is executed without the destination being specified in the Dexterity Run Report code.
     
  2. In the Dynamics.dic. This Report Destination window is used by developers to ask for report destination information in advance. This information is then passed to the report writer when the developer calls a report, usually after some sort of temporary file processing.

 

The first Report Destination window from the runtime cannot be customized by VBA or Dexterity.  You cannot add it to VBA and you cannot register a Dexterity trigger against it.  [Edit] In the more recent builds of Dexterity it is possible to register a cross dictionary trigger against the Dex.dic using Dictionary ID = 1.

The only interactions that are possible with this window are by using the VBA's SendKeys command to control using keyboard key strokes or using pass through Dexterity sanScript. 

The Dex.dic can be referenced as dictionary 1 with the execute() function or the unsupported method of calling Dexterity from VBA via the Continuum Integration Library.  Please see the materials in the following posts for more information on these methods:

Cross Dictionary Dexterity Development 

Microsoft Dynamics GP Technical Airlift 2008

 

The second Report Destination window which is part of the core Dynamics.dic application dictionary and can be referenced easily by both VBA and Dexterity.

I hope this explains the apparent inconsistent behavior.

David

10-Jan-2011: Mention that cross dictionary triggers against Dex.dic are possible now.

Comments

  • Anonymous
    November 04, 2009
    Posting from DynamicAccounting.net http://msdynamicsgp.blogspot.com/2009/11/automating-or-customizing-report.html

  • Anonymous
    January 05, 2011
    David, Sorry but again, i disagree with you on below. We can register trigger for report destination window. >>The first Report Destination window ...you cannot register a Dexterity trigger against it. >> Thanks, elmo

  • Anonymous
    January 09, 2011
    Hi Elmo Registering triggers against Dex.dic was originally not possible as the product ID 1 did not appear in the Dynamics.set.  In more recent builds of Dexterity (not sure when) this became possible. I have updated the article to mention this. Thanks for your feedback. David

  • Anonymous
    January 24, 2011
    >>>Thanks for your feedback Do you really mean it? LOL >>> In more recent builds of Dexterity (not sure when) this became possible. Nops It's not with recent builds but it was as old as GP8, I applied it myself. Anyway it was just to tease someone who think 'David is always right', your big fan and someone I know. Of course you know him too.

  • Anonymous
    January 25, 2011
    Hi Elmo Absolutely, I love feedback ... even if it is to correct something.  There is always something new to learn. I originally tried triggers on the dex.dic back in v5.1 when I was testing the new cross dictionary trigger commands Dave Gaboury was working on.  They did not work back then, and I never tried again until the issue was raised again recently. I am not sure what version it started working on, but I am glad it works now. Quote of the day: "There was one time I thought I was wrong.... but I was mistaken.". :-) David

  • Anonymous
    January 25, 2011
    "There was one time I thought I was wrong.... but I was mistaken.". Nice one, applies to all of us 'Humans'.  :) elmo

  • Anonymous
    November 07, 2011
    Great article!

  • Anonymous
    November 17, 2011
    Using VSTools, is there anyway to control the 'Report Destination' window that pops up when transferring a Sales Order to Invoice. Alternatively, can report options be changed so that no reports are printed. Andrew

  • Anonymous
    November 21, 2011
    The comment has been removed

  • Anonymous
    August 10, 2014
    Hi David, I found your articles to be very helpful. I recently ran into having to automate the Report Destination window as well. I made the assumption that the Report Destination window is a standard Windows modal dialog. I was able to obtain control over this window and following your example I wrote my first article hoping it would help other fellow programmers in dealing with this issue: www.codeproject.com/.../Closing-Microsoft-Dynamics-GP-Report-Destination-w Thank you, Paul

  • Anonymous
    August 11, 2014
    Hi Paul Thanks for the information and the link to your article. David

  • Anonymous
    November 13, 2014
    The comment has been removed

    • Anonymous
      July 25, 2016
      the GP Web Client, if you have Word Templates Enabled, it defaults ALL reports to TEMPLATE in the report destination window. I want to do a simple customization that will check to see the Template Configuration Setup tables each time the Report Destination window is loaded in GP and set the Report Type to Standard or Template based on whether the Word Template is set as the Default. It would look something like below. Its just the basic logic(obviously the syntax is not good but you get the picture) but the query is good. My question is: Could I accomplish this using VS Tools for the Web Client? Declare TempIDTempID = TemplateIDFrom ReportDestinationWindowSelect * from DYNAMICS.dbo.SY20000 ainner join DYNAMICS.dbo.SY20020 b on a.TemplateID = b.TemplateIDwhere CMPANYID = 3 and a.TemplateID = TempID and IsDefault = 1IF EndOfFile thenSet ReprtType = StandardElseSet ReportType = TemplateEnd IfThanks!
      • Anonymous
        July 27, 2016
        Hi DavidYou could use Visual Studio, Dexterity or even GP Power Tools triggers to adjust the behaviour of the window.David