How to suppress Crystal Reports 7 Parameter Prompt

Posted on 2007-08-10
Last Modified: 2008-01-09
We're supporting a client using a VB6 application and an Access 97 database to produce Crystal Reports version 7 (Standard Edition). They require some urgent changes, including a new report. The report requires the VB app to pass a parameter to display on the page header. So far so good and no problems doing any of this. However, Crystal keeps displaying the parameter prompt prior to showing the report and we simply cannot find a way of suppressing it.

Here's how we're passing the parameter to be displayed in a Crystal parameter field named 'SelectionCriteria'

ParameterFields(0) = "SelectionCriteria;" & PValue$ & ";False"

Changing False to True also results in the parameter prompt display appearing.

Surely there must be a way of suppress this annoying popup.

Any help greatly appreciated.

Question by:dmarch100
    LVL 53

    Accepted Solution

    I'm not sure that cr7 supports setParameterValue..

    The following code is an example of how to use the
    SetParameterValue() method in a Visual Basic.NET application:

    Dim rpt As New ReportDocument
    rpt.SetParameterValue("Country", "Canada")

    The SetParameterValue() method can only be used to
    pass a single value to a report parameter field.
    It cannot be used to pass multiple or range values.


    Author Comment

    I don't have a problem passing/displaying/printing the parameter value... what I need to do is suppress Crystal Reports from displaying the Parameter Prompt screen
    LVL 53

    Expert Comment

    I read somewhere that the setparametervalue automatically supresses the prompt screen
    LVL 1

    Assisted Solution

        Dim rptpath As String = Server.MapPath("YourReport.rpt")
                Dim oReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument

                Dim oCRDb As CrystalDecisions.CrystalReports.Engine.Database = oReport.Database
                Dim oCRTables As CrystalDecisions.CrystalReports.Engine.Tables = oCRDb.Tables
                Dim oCRTable As CrystalDecisions.CrystalReports.Engine.Table
                Dim oCRTableLogonInfo As CrystalDecisions.Shared.TableLogOnInfo
                Dim oCRConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
                Dim oCREndDateParam As CrystalDecisions.Shared.ParameterField
                oCRConnectionInfo.DatabaseName = dbname
                oCRConnectionInfo.ServerName = srvname
                oCRConnectionInfo.UserID = uname
                oCRConnectionInfo.Password = pwd
                For Each oCRTable In oCRTables
                    oCRTableLogonInfo = oCRTable.LogOnInfo
                    oCRTableLogonInfo.ConnectionInfo = oCRConnectionInfo
                    oCRTable.Location = oCRTableLogonInfo.ConnectionInfo.DatabaseName & ".dbo." & oCRTable.Name

                oReport.SetParameterValue(0, parameter1)
                oReport.SetParameterValue(1, parameter2)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    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 …
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    761 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

    8 Experts available now in Live!

    Get 1:1 Help Now