PC Review


Reply
Thread Tools Rate Thread

Cannot suppress parameter prompts at runtime (Crystal Report)

 
 
Bill Nguyen
Guest
Posts: n/a
 
      9th Apr 2004
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(ParameterDiscreteValue0)

ParameterField1.CurrentValues.Add(ParameterDiscreteValue1)

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



 
Reply With Quote
 
 
 
 
Jernej Kase
Guest
Posts: n/a
 
      14th Apr 2004
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" <(E-Mail Removed)> wrote in message news:<OEA$(E-Mail Removed)>...
> 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(ParameterDiscreteValue0)
>
> ParameterField1.CurrentValues.Add(ParameterDiscreteValue1)
>
> 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

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Report prompts for value (Crystal reports & VB .net) paul Microsoft VB .NET 0 11th May 2007 07:50 PM
Report generated but prompts for parameter when printing teddysnips@hotmail.com Microsoft Access 5 12th Oct 2006 11:28 AM
How to suppress Crystal report dialog box at runtime Bill Nguyen Microsoft VB .NET 0 24th Jun 2005 06:15 PM
problem using 'Suppress if duplicated' with a field in a Crystal report Eych Microsoft VB .NET 1 27th Aug 2004 07:07 PM
Parameter Query with 2 many prompts in Report DSmith Microsoft Access Queries 1 7th Feb 2004 12:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:47 PM.