Crystal Viewer is not viewing report

Posted on 2005-04-28
Last Modified: 2007-12-19
This is my code:

Dim crxApp As New CRAXDRT.Application
    Dim crxRpt As CRAXDRT.Report

    ' Open the report
    Set crxRpt = crxApp.OpenReport(App.Path & "\PrtPicTkt.rpt")

    ' Clear any saved data to force the report to read from the db

    ' Set the connection for the report.
    crxRpt.Database.Tables(1).SetLogOnInfo "Macola02", "Macola02", "administrator", "odyssey"

    ' Set up the report source
    frmUserInput.CRViewer1.ReportSource = crxRpt
    'frmUserInput.CrystalReport1.ReportFileName = App.Path & "\PrtPicTkt.rpt"
    Do ' more than one report per run

        ' Create itemSelect
        ' Set up selection formula
       ' frmUserInput.CrystalReport1.SelectionFormula = itemSelect
        crxRpt.RecordSelectionFormula = itemSelect

        ' View report
        ' frmUserInput.CrystalReport1.Action = 1

When I execute this code it does not bring up the viewer.  If I uncomment the three CrystalReport1 statements , then I get the viewer but it is not persistent.  It lasts a second and then the next report is viewed without waiting for a response from the first view.

Can anyone tell me what's going wrong?
Question by:tblock
    LVL 100

    Expert Comment

    YOur code looks good.  What does itemSelect have?

    You have your viewing in a loop thus it keeps trying to recreate the viewer.

    Basic code I use is

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

    '   Open report
        Set crApp = New CRAXDRT.Application

        Set crRpt = crApp.OpenReport(txtReportName, 1)

    '   Set flags for CRViewer

        crRpt.MorePrintEngineErrorMessages = False
        crRpt.EnableParameterPrompting = False
        crRpt.DisplayProgressDialog = False

    ' Set the viewer's report source to the Report object
      Me.rptCRViewer.ReportSource = crRpt

    LVL 13

    Accepted Solution

    Have a look at this whitepaper on displaying multiple reports in the same Viewer using the ReportSourceRoute:


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    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 …
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now