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

No Reviews Yet.

 
GPWindow.com

Thank you for your support for GPWindow. It helps us cover part of the hosting costs for GPWindow.