Solved

Printing Reports in CRXI and VB 6

Posted on 2006-10-26
4
375 Views
Last Modified: 2007-12-19
How can I just pritn a CRXI report from VB6 without going thru the ActiveXReportViewer and adding the report in as a Designer. Really Dont do a lot of viewing of reports Just want them to go directly to the printer.  Or am I going to have to "hide" the viewer and then print it?  Which just seems like a waste.

Thanks in advance
0
Comment
Question by:KOCUBA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 150 total points
ID: 17813117
Here is the basic code for printing.  You will need to add CRAXDRT.DLL to the references. (Crystal Reports ActiveX Designer Runtime

Option Explicit
    Private crApp As CRAXDRT.Application
    Private crRpt As CRAXDRT.Report

'
'   Check if report is already in use
'
        If IsObject(crRpt) Then
           Set crRpt = Nothing
        End If

'
'   Open report
'
        Set crApp = New CRAXDRT.Application

        Set crRpt = crApp.OpenReport("C:\Crystal\MyReports\MyReport.rpt", 1)

'
'  Filter the data if desired
'
        crRpt.RecordSelectionFormula = "{SomeField} = 'SomeValue'"

'
'   Set flags for CRViewer
'
        crRpt.MorePrintEngineErrorMessages = False
        crRpt.EnableParameterPrompting = False
        crRpt.DiscardSavedData

'
'   Print Report
'
      crRpt.DisplayProgressDialog = False
      crRpt.PrintOut False

End Sub

mlmcc
0
 

Author Comment

by:KOCUBA
ID: 17813719
Thanks.  Just didn't have the time to search for it with running on a evaluation copy.
0
 

Author Comment

by:KOCUBA
ID: 17813734
Man do you and frodoman work for Crystal?   lol

Thanks Again

Now I can get back to testing the solution to my other qustion
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 17813959
Glad i could help

mlmcc
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question