web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

GP Print Macros

(0) ShareShare
ReportReport
Posted on by

I am trying to create a macro that will print 20 financial reports in one run.  I can get the reports to print but they run off the page because the print settings need to be Landscape with scaling at 75%.  I can go into the manual print settings on screen output and change the settings and print the reports manually.  When I record the macro it records everything but the printer settings.  I can only select the printer and # of copies.  How can I pick up the other printer settings in the macro?  My code is as followings (code is just for 1 of 20 reports because I can duplicate it 19 more times when it is perfected) :

# DEXVERSION=14.00.0085.000 2 2
CheckActiveWin dictionary 'default' form 'GL_Financial_Statement_Report' window 'Main_Reports'
CommandExec dictionary 'default' form 'GL_Financial_Statement_Report' command 'Print Button_w_Main_Reports_f_GL_Financial_Statement_Report'
NewActiveWin dictionary 'default' form 'Report_Destination' window 'Report_Destination'
MoveTo field 'OK Button'
ClickHit field 'OK Button'
NewActiveWin dictionary 'default' form 'GL_Financial_Statement_Report' window 'Main_Reports'
NewActiveWin dictionary 'DEX.DIC' form 'Reports Screen' window 'Screen Output'
ActivateWindow dictionary 'DEX.DIC' form 'Reports Screen' window 'Report Screen'
WindowMove dictionary 'DEX.DIC' form 'Reports Screen' window 'Screen Output' pointh 0 pointv 2
ActivateWindow dictionary 'DEX.DIC' form 'Reports Screen' window 'Screen Output'
ActivateWindow dictionary 'DEX.DIC' form 'Reports Screen' window 'Report Screen'
ActivateWindow dictionary 'DEX.DIC' form 'Reports Screen' window 'Screen Output'
WindowSize dictionary 'DEX.DIC' form 'Reports Screen' window 'Report Screen' pointh 1380 pointv 40
ActivateWindow dictionary 'DEX.DIC' form 'Reports Screen' window 'Screen Output'
ActivateWindow dictionary 'DEX.DIC' form 'Reports Screen' window 'Report Screen'
MoveTo field '(L) Print'
ClickHit field '(L) Print'
PrintDialog copies 1 hori_adj 0 vert_adj 0 pages '1' printer 'TSPrint PDF'
CloseWindow dictionary 'DEX.DIC' form 'Reports Screen' window 'Screen Output'

This code works perfect except that I need it to print landscape scaled 75%.  Right now my reports run off the page on the right side, big time.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Frank_Heslin Profile Picture
    895 on at

    I just went into a report & changed the settings to 75%, and from File > Print Setup changed it to landscape, and saved the settings.  I think if you do that on the front end, then when you actually print them, the settings will already be the way you want them.

    Let us know if this works.

  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,058 Moderator on at

    Hi Brad,

    The answer you got from Frank is only good if 'all' your reports are using the same layout to print .. but the issue might be that from your 20 reports, only a handful might need the landscape mode & reduced to 75% to fit the page.. 

    Unfortunately I don't think you'll be able to achieve this within the macro recorder in GP, not the way you try to do it.. The macro recorder can only capture DEXTERITY related actions, and typically the printer settings dialog box to change printer properties are not DEX code related, but Windows resources.. (OS).

    In order to achieve what you want, I believe you could use the 'named printer' feature in GP, which basically allows you to define 'print queues' with pre-defined sets of parameters for specific print jobs in GP (i.e. landscape mode, and different paper source for 1st page for example).

    This could be pre-set in your GP environment and when it comes to record the macros, you could only just refer to the 'name printer' instance queue to select the output queue for your report.

     

    Use the Assign Named Printers window to create printer IDs for assigned tasks. You can create an unlimited number of printer IDs. You can also create multiple printer IDs with different settings for the same printer. For example, you can create two printer IDs, one that prints with landscape orientation and one that prints with portrait orientation, for the same printer.

    To use this window, you must first set up a named printer. For more information, refer to Chapter 2, “Printers,” in the System Administrator’s Guide (Help >> Contents >> select System Administration).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans