473,659 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 CrystalDecision s.Shared.Parame terFields

Dim ParameterField0 As CrystalDecision s.Shared.Parame terField

Dim ParameterField1 As CrystalDecision s.Shared.Parame terField

Dim ParameterDiscre teValue0 As
CrystalDecision s.Shared.Parame terDiscreteValu e

Dim ParameterDiscre teValue1 As
CrystalDecision s.Shared.Parame terDiscreteValu e

ParameterFields = New CrystalDecision s.Shared.Parame terFields

ParameterField0 = New CrystalDecision s.Shared.Parame terField

ParameterField0 .ParameterField Name = "@salesdate "

ParameterField1 = New CrystalDecision s.Shared.Parame terField

ParameterField1 .ParameterField Name = "@inflag"

ParameterDiscre teValue0 = New CrystalDecision s.Shared.Parame terDiscreteValu e

ParameterDiscre teValue0.Value = rptParam0

ParameterDiscre teValue1 = New CrystalDecision s.Shared.Parame terDiscreteValu e

ParameterDiscre teValue1.Value = rptParam1

ParameterField0 .CurrentValues. Add(ParameterDi screteValue0)

ParameterField1 .CurrentValues. Add(ParameterDi screteValue1)

ParameterFields .Add(ParameterF ield0)

ParameterFields .Add(ParameterF ield1)

lblPrintWait.Te xt = "Loading report. Please wait..."

lblPrintWait.Vi sible = True

Me.Cursor = Cursors.WaitCur sor

With myCrystal.Cryst alReportViewer1

..ReportSource( ) = reportDocument1

..SelectionForm ula = mSelection

If rptParam0 <> "NA" Then

..ParameterFiel dInfo = ParameterFields

End If

'.ShowExportBut ton = True

'.ShowPageNavig ateButtons = True

..ShowPrintButt on = True

'.PrintReport()

..RefreshReport ()

End With

Me.Cursor = Cursors.Default

lblPrintWait.Vi sible = False

myCrystal.Windo wState = FormWindowState .Maximized

myCrystal.ShowD ialog()

Catch ex As Exception

MsgBox(ex.Sourc e & ": " & ex.Message)

End Try

Nov 20 '05 #1
1 6387
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******* *******@TK2MSFT NGP12.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 CrystalDecision s.Shared.Parame terFields

Dim ParameterField0 As CrystalDecision s.Shared.Parame terField

Dim ParameterField1 As CrystalDecision s.Shared.Parame terField

Dim ParameterDiscre teValue0 As
CrystalDecision s.Shared.Parame terDiscreteValu e

Dim ParameterDiscre teValue1 As
CrystalDecision s.Shared.Parame terDiscreteValu e

ParameterFields = New CrystalDecision s.Shared.Parame terFields

ParameterField0 = New CrystalDecision s.Shared.Parame terField

ParameterField0 .ParameterField Name = "@salesdate "

ParameterField1 = New CrystalDecision s.Shared.Parame terField

ParameterField1 .ParameterField Name = "@inflag"

ParameterDiscre teValue0 = New CrystalDecision s.Shared.Parame terDiscreteValu e

ParameterDiscre teValue0.Value = rptParam0

ParameterDiscre teValue1 = New CrystalDecision s.Shared.Parame terDiscreteValu e

ParameterDiscre teValue1.Value = rptParam1

ParameterField0 .CurrentValues. Add(ParameterDi screteValue0)

ParameterField1 .CurrentValues. Add(ParameterDi screteValue1)

ParameterFields .Add(ParameterF ield0)

ParameterFields .Add(ParameterF ield1)

lblPrintWait.Te xt = "Loading report. Please wait..."

lblPrintWait.Vi sible = True

Me.Cursor = Cursors.WaitCur sor

With myCrystal.Cryst alReportViewer1

.ReportSource() = reportDocument1

.SelectionFormu la = mSelection

If rptParam0 <> "NA" Then

.ParameterField Info = ParameterFields

End If

'.ShowExportBut ton = True

'.ShowPageNavig ateButtons = True

.ShowPrintButto n = True

'.PrintReport()

.RefreshReport( )

End With

Me.Cursor = Cursors.Default

lblPrintWait.Vi sible = False

myCrystal.Windo wState = FormWindowState .Maximized

myCrystal.ShowD ialog()

Catch ex As Exception

MsgBox(ex.Sourc e & ": " & 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
1089
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 report the corresponding report will come. Now i come to my problem what are all the Items which i entered in data entry form it is not displayed in
1
1987
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 binding expression "C:\stats.rpt" which is a valid Crystal Report and this appears successfully on the Design view with the correct columns. However, when I try to see this page on the web, I get the error "Use ReportSource or DataBindings...
2
2203
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
984
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 correctly. Also, print option grayed out although it was available at design time. Thanks a million! Bill
13
4994
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 form and I am assigning a variable to it here: Dim anrpt As New ArmbandNumbers When this line executes I get the error that "The System cannot find the file specified." and highlights MyBase.New in the report's vb language.
0
1080
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
3695
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: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\ cstringt.h(875): error C2664: 'PtrToStringChars' : cannot convert parameter 1 from 'unsigned char *' to 'const System::String __gc *' The code segemnt is:
4
3192
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 .parameter syntax, a dialog box always appear that says "Enter Parameter Values" before the report. Pls, I know you can help me with this. Thank you so much!!
1
2468
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 as the application (i parsed the connection string and set the ConnectionInfo) However, the crystal report fails to logon and gives an exception : Logon failed. Error in File Quote {E2D18712-BD5A-4EE7-867E-79F137EB549D}.rpt: Unable to connect:...
0
8330
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8523
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8626
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6178
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2749
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.