473,398 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 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 6365
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.