Home » Listing Details
Top Websites
  1. Mark Polino's DynamicAccounting.net
    Over 3700 resources listed.
  2. Developing for Dynamics GP - By David Musgrave and the MS GP Dev Support Team
    Over 700 resources listed.
  3. Mariano Gomez at The Dynamics GP Blogster
    Over 600 resources listed.
  4. Mohammad Daoud's Dynamics GP Blog
    Over 400 resources listed.
  5. Microsoft Dynamics Partner Community Blog
    Over 400 resources listed.
  6. Vaidy Mohan at Dynamics GP - Learn & Discuss
    Over 400 resources listed.
  7. Dynamics GP Help
    Over 400 resources listed.
  8. Christina Phillips, Steve Endow & Lorren Zemke at Dynamics GP Land
    Over 300 resources listed.
  9. Frank Hamelly at GP2theMax
    Over 200 resources listed.
  10. About Dynamics, Development and Life
    Over 200 resources listed.
  11. eOne Business Solutions Blog
    Over 200 resources listed.
  12. Inside Microsoft Dynamics GP Official Blog
    Over 200 resources listed.
  13. VS Tools Forum
    Over 100 resources listed.
    Your Resource for Visual Studio Tools for Dynamics GP
  14. Inside Microsoft Dynamics GP Official Blog
    Over 100 resources listed.
  15. Janakiram M.P. at DynamicsBlogger
    Over 100 resources listed.
  16. Victoria Yudin's Dynamics GP Website
    Over 100 resources listed.
    Victoria Yudin
  17. Catherine Eibner MBS Developer Evangelist
    Over 100 resources listed.
  18. Sivakumar Venkataraman at Interesting Findings & Knowledge Sharing
    Over 100 resources listed.
  19. Dynamics CPM
    Over 100 resources listed.
  20. Dynamics Small Business
    Over 100 resources listed.
  21. Belinda, The GP CSI
    Over 100 resources listed.
  22. Rose Business Solutions Blog New
    Over 100 resources listed.
  23. Microsoft Dynamics GP UK Blog
    Over 100 resources listed.
  24. Leslie Vail at Dynamics Confessor Blogspot
    99 resources listed.
  25. Michael Johnson at MBS Guru
    96 resources listed.

ID:9424
Title:Print Crystal Report Directly to the printer using VBA
URL:http://mohdaoud.blogspot.com/2009/10/print-crystal-report-directly-to.html
Description:

One of my friends asked me about how to directly print the crystal report to the printer using VBA on pressing a button on any of Microsoft Dynamics GP Windows, and I thought I should share this tip:

First, on your VBA project, go to Tools>> References and add a reference to

"Crystal Reports ActiveX Designer Design and Runtime Library"

image

Place your report in an accessible location to be loaded, then place code below where you need to print the report:

Dim CRApp As New CRAXDDRT.Application
Dim CRReport As New CRAXDDRT.Report
Set CRReport = CRApp.OpenReport("C:\rptAccounts.rpt", 1)

Dim CP As CRAXDDRT.ConnectionProperties
For Each tbl In CRReport.Database.Tables
    Set CP = tbl.ConnectionProperties
    CP.Item("User ID") = "sa"
    CP.Item("Password") = "123"
    CP.Item("Data Source") = ".\SQL2005"
    CP.Item("Initial Catalog") = "TWO"
Next tbl
CRReport.PrintOut False

Change "C:\rptAccounts.rpt" to your actual report path and enjoy!

Regards,
--
Mohammad R. Daoud
MVP, MCP, MCBMSP, MCTS, MCBMSS
Software Development Manager
+962 - 79 - 999 65 85
Great Package For Business Solutions
daoudm@greatpbs.com
http://www.greatpbs.com

Category:REPORTING: Crystal Reports
Link Owner:
Date Added:June 17, 2010 04:19:41 AM
Number Hits:19
RatingsAverage rating: (0 votes)
Reviews

No Reviews Yet.

 
GPWindow.com

Developed and presented by
Smith & Allen Consulting, Inc.,
GP specialists since 1991.