472,975 Members | 1,680 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,975 software developers and data experts.

Cannot suppress parameter prompts at runtime (Crystal Report)

Report source is an SQLSERVER 2K store procedure. VB.NET application. Report
created by CR 8.5.
At runtime, I still had to click "CANCEL" to bypass the parameter prompts
before the report display correctly. Also, print option grayed out although
it was available at design time.
Thanks a million!
Bill

---------------

Below is the code:

crRptName = crRptPath & Trim(rptName)

Try

reportDocument1.Load(crRptName)
Dim ParameterFields As CrystalDecisions.Shared.ParameterFields

Dim ParameterField0 As CrystalDecisions.Shared.ParameterField

Dim ParameterField1 As CrystalDecisions.Shared.ParameterField

Dim ParameterDiscreteValue0 As
CrystalDecisions.Shared.ParameterDiscreteValue

Dim ParameterDiscreteValue1 As
CrystalDecisions.Shared.ParameterDiscreteValue

ParameterFields = New CrystalDecisions.Shared.ParameterFields

ParameterField0 = New CrystalDecisions.Shared.ParameterField

ParameterField0.ParameterFieldName = "@salesdate"

ParameterField1 = New CrystalDecisions.Shared.ParameterField

ParameterField1.ParameterFieldName = "@inflag"

ParameterDiscreteValue0 = New CrystalDecisions.Shared.ParameterDiscreteValue

ParameterDiscreteValue0.Value = rptParam0

ParameterDiscreteValue1 = New CrystalDecisions.Shared.ParameterDiscreteValue

ParameterDiscreteValue1.Value = rptParam1

ParameterField0.CurrentValues.Add(ParameterDiscret eValue0)

ParameterField1.CurrentValues.Add(ParameterDiscret eValue1)

ParameterFields.Add(ParameterField0)

ParameterFields.Add(ParameterField1)

lblPrintWait.Text = "Loading report. Please wait..."

lblPrintWait.Visible = True

Me.Cursor = Cursors.WaitCursor

With myCrystal.CrystalReportViewer1

..ReportSource() = reportDocument1

..SelectionFormula = mSelection

If rptParam0 <> "NA" Then

..ParameterFieldInfo = ParameterFields

End If

'.ShowExportButton = True

'.ShowPageNavigateButtons = True

..ShowPrintButton = True

'.PrintReport()

..RefreshReport()

End With

Me.Cursor = Cursors.Default

lblPrintWait.Visible = False

myCrystal.WindowState = FormWindowState.Maximized

myCrystal.ShowDialog()

Catch ex As Exception

MsgBox(ex.Source & ": " & ex.Message)

End Try

Nov 20 '05 #1
1 6326
This won't solve your problems, but...

I've got the same problem. Today I discovered that "enter parameter
values" dialog is only shown if the form (or crystal viewer) is not
visible.
This is crazy! I've been trying to find a workarround. The problem is
(in my case) that the dialog is displayed even if the form's visible
property is set to true and location is in invisible area.

I hope we find a workarround.

Regards,
Jernej

"Bill Nguyen" <bi*****************@jaco.com> wrote in message news:<OE**************@TK2MSFTNGP12.phx.gbl>...
Report source is an SQLSERVER 2K store procedure. VB.NET application. Report
created by CR 8.5.
At runtime, I still had to click "CANCEL" to bypass the parameter prompts
before the report display correctly. Also, print option grayed out although
it was available at design time.
Thanks a million!
Bill

---------------

Below is the code:

crRptName = crRptPath & Trim(rptName)

Try

reportDocument1.Load(crRptName)
Dim ParameterFields As CrystalDecisions.Shared.ParameterFields

Dim ParameterField0 As CrystalDecisions.Shared.ParameterField

Dim ParameterField1 As CrystalDecisions.Shared.ParameterField

Dim ParameterDiscreteValue0 As
CrystalDecisions.Shared.ParameterDiscreteValue

Dim ParameterDiscreteValue1 As
CrystalDecisions.Shared.ParameterDiscreteValue

ParameterFields = New CrystalDecisions.Shared.ParameterFields

ParameterField0 = New CrystalDecisions.Shared.ParameterField

ParameterField0.ParameterFieldName = "@salesdate"

ParameterField1 = New CrystalDecisions.Shared.ParameterField

ParameterField1.ParameterFieldName = "@inflag"

ParameterDiscreteValue0 = New CrystalDecisions.Shared.ParameterDiscreteValue

ParameterDiscreteValue0.Value = rptParam0

ParameterDiscreteValue1 = New CrystalDecisions.Shared.ParameterDiscreteValue

ParameterDiscreteValue1.Value = rptParam1

ParameterField0.CurrentValues.Add(ParameterDiscret eValue0)

ParameterField1.CurrentValues.Add(ParameterDiscret eValue1)

ParameterFields.Add(ParameterField0)

ParameterFields.Add(ParameterField1)

lblPrintWait.Text = "Loading report. Please wait..."

lblPrintWait.Visible = True

Me.Cursor = Cursors.WaitCursor

With myCrystal.CrystalReportViewer1

.ReportSource() = reportDocument1

.SelectionFormula = mSelection

If rptParam0 <> "NA" Then

.ParameterFieldInfo = ParameterFields

End If

'.ShowExportButton = True

'.ShowPageNavigateButtons = True

.ShowPrintButton = True

'.PrintReport()

.RefreshReport()

End With

Me.Cursor = Cursors.Default

lblPrintWait.Visible = False

myCrystal.WindowState = FormWindowState.Maximized

myCrystal.ShowDialog()

Catch ex As Exception

MsgBox(ex.Source & ": " & ex.Message)

End Try

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Vetril Group | last post by:
Respected sir, I created 3 parameters in Crystal Report, In my runtime form consits of main menu, if we click that menu we can data entry in the form, and if they click on the particular...
1
by: Mike Pettet | last post by:
I've just started using .NET and cannot create a basic Crystal Report. I have created an aspx page with a CrystalReportViewer web form on it. I defined (DataBindings)->ReportSource as the custom...
2
by: Raj | last post by:
How to pass a Two Date parameter to a report at runtime using VB .NET -- Raj Kumar Mishra jcast Networks Ltd. New Delhi. India. 91-51678212,13,14
0
by: Bill Nguyen | last post by:
Report source is an SQLSERVER 2K store procedure. VB.NET application. Report created by CR 8.5. At runtime, I still had to click "CANCEL" to bypass the parameter prompts before the report display...
13
by: Brad | last post by:
I will also post this in the CR group but because I program in VB maybe somebody here might be able to help. I am working on a new project that incorporates a few forms. I just created my first...
0
by: Bill Nguyen | last post by:
When a CR report is exported/saved to a file, the screen briefly displays the record processing info. Is there anyway to suppress it? Thanks Bill
0
by: Madhu_TN | last post by:
Hi All, I am new to this board. I am trying to create a Crystal Report viewer into a VS C++ Dot NET 2003 app ( This uses both managed and unmanaged code). I get the following compilation error:...
4
by: MarkTingson | last post by:
Hi guys, Is there a way to prevent "Enter Parameter Values" message box to pop during VB6 program runtime?I have created a program in VB6 that uses a Crystal report control. When I put a...
1
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi, I have bumped into this issue where my application (which consistently reads the database) has to also create a crsytal report when requested. The crystal repost uses the same connection string...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.