[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I remove the 'enter parameter values' dialog in Crystal Reports called from a VB 2005 app

Posted on 2007-09-28
16
Medium Priority
?
8,297 Views
Last Modified: 2013-11-26
I am opening up a Crstal Report through VB 2005.  The report works exactly as it should except the enter parameter values dialog keeps popping up.  I have no idea why this keeps happening .

Here is my code

Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load

        If Form1.ScoringTypeTextBox.Text = "1" Then
            CrystalReportViewer1.ReportSource = CrystalReport21
        End If

        If Form1.ScoringTypeTextBox.Text = "2" Then
            CrystalReportViewer1.ReportSource = EventScores21
        End If

        If Form1.EventDescTextBox.Text = "Golf Scramble" Then
            CrystalReportViewer1.ReportSource = CrystalReport11
        End If

        CrystalReportViewer1.RefreshReport()
        Dim myParameterFields As CrystalDecisions.Shared.ParameterFields = CrystalReportViewer1.ParameterFieldInfo
        Dim myParameterField As CrystalDecisions.Shared.ParameterField = myParameterFields("EventID")

        Dim currentParameterValues As CrystalDecisions.Shared.ParameterValues = New CrystalDecisions.Shared.ParameterValues()
        Dim myParameterDiscreteValue As CrystalDecisions.Shared.ParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue()
        myParameterDiscreteValue.Value = Form1.mEventID
        currentParameterValues.Add(myParameterDiscreteValue)

        myParameterField.DefaultValues = currentParameterValues
        myParameterField.CurrentValues = currentParameterValues

    End Sub
0
Comment
Question by:monica73174
  • 5
  • 3
  • 3
  • +4
16 Comments
 
LVL 14

Expert Comment

by:Jai S
ID: 19978802
you have to set the parameters as hidden...
in your report --> parameter properties --> set it hidden
0
 
LVL 27

Expert Comment

by:VBRocks
ID: 19978816
Actually, try opening the Report up in the Designer, then looking in the Field Explorer for any parameters.
If there are any parameters there, then they may pop up a dialog box when the report is loaded.

0
 
LVL 27

Expert Comment

by:VBRocks
ID: 19978825
(Field Explorer > Parameter fields > parameters)

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 101

Expert Comment

by:mlmcc
ID: 19978878
What version of Crystal?

Are you passing values to all parameters?

Check pages 155-160
http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf

mlmcc
0
 

Author Comment

by:monica73174
ID: 19978890
All it says is Crystal Reports for Visual Studio 2005.
0
 
LVL 14

Expert Comment

by:Jai S
ID: 19978908
are you reading the prev posts ?
0
 

Author Comment

by:monica73174
ID: 19979012
There is a parameter in the parameter fields, I have tried to remove this but it says its being used in the report.  I am not sure where because I do not see it.  Also I do not see where I can set the parameter properties as hidden.  There is nothing in the properties of the report.  I also tried clicking on the parameter and looking there.  Is there some where else I make it hidden?

0
 
LVL 14

Expert Comment

by:Jai S
ID: 19979031
do not remove the parameter...you have set its visibility to false or hidden true...check in the properties.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 19979056
WHere is the visibility property?  I am not aware of it in any version of Crystal.

You can set an EnableParameterPrompting to FALSE.

Parameters will be prompted for if
1.  A value is not passed to all parameters
2.  An invalid value is passed to a parameter

How many parameters does the report have?

The parameter is probably in use in the REPORT --> SELECT EXPERT to filter the data.  That is the general use of parameters.

mlmcc
0
 

Author Comment

by:monica73174
ID: 19979121
Yes, I could not find any reference to making the parmeter hidden.  The report has one property.  The report displays fine.  So in my sub procedure I would set that EnableParameterPrompting to FALSE?  I am assuming that is what is meant here.  
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 19979356
Yes.  You may be able to set it on the Report properties but generally it is done in code before calling the report.

mlmcc
0
 

Author Comment

by:monica73174
ID: 19979431
I tried doing this but it errors.  

 CrystalReport21.EnableParameterPrompting = False
0
 
LVL 42

Accepted Solution

by:
frodoman earned 2000 total points
ID: 19979739
Hi Monica,

Comment out this line of code:   CrystalReportViewer1.RefreshReport()

Give it a try now.  You're calling refresh before you set the parameters so you're being prompted for parameter values based on the refresh...

frodoman
0
 

Author Comment

by:monica73174
ID: 19979995
Thank you removing the line CrystalReportViewer1.RefreshReport() worked!  
0
 

Expert Comment

by:a_k93
ID: 21048257
Thnx a lot,

I have got the soln what I was looking for.
0
 

Expert Comment

by:disbekearney
ID: 25260789
Is there any way to hide the 'Enter Parameter Values' dialog box from within settings of Crystal XI?

or is this only possible from the .net code reporting engine?

--------------------------------------------------
-An existing engine is passing a formula value to crystal.  (not possible to change this to pass a param  
       instead of formulas)
-setting  ?parameter=@formula        inside record selection formula.
-passing params to procedure
-procedure returns recordset
---------------------------------------------------

the problem is that my engine asks for formula values (used as params)
then crystal is also asking for those param values (which will be replaced anyway by the record selection formula)

so the user will get asked twice for params.  again i dont think changing engine functionality is best solution here.    thanks in advance for advice!  from the help i've got here i think i owe mlmcc and frodo a beer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

873 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