469,301 Members | 2,282 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,301 developers. It's quick & easy.

Disable/Remove Enter Parameter Values Window in Crystal Report

I am trying to make a report which gets its data from a windows form's textboxes. My code works fine but upon display of the report, a window always appear asking to enter parameter values. How can I bypass or remove this window? Here is my code:

Dim report As rptVoucherReceipt = New rptVoucherReceipt
Dim crParameterDiscreteValue As ParameterDiscreteValue
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldLocation As ParameterFieldDefinition
Dim crParameterValues As ParameterValues

crParameterFieldDefinitions = report.DataDefinition.ParameterFields

crParameterFieldLocation = crParameterFieldDefinitions.Item("parAmtWords")
crParameterValues = crParameterFieldLocation.CurrentValues
crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue
crParameterDiscreteValue.Value = frmPremPay.txtAmtWords.Text
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldLocation.ApplyCurrentValues(crPara meterValues)

crParameterFieldLocation = crParameterFieldDefinitions.Item("parPayAmt")
crParameterValues = crParameterFieldLocation.CurrentValues
crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue
crParameterDiscreteValue.Value = frmPremPay.txtPremPayPayAmt.Text
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldLocation.ApplyCurrentValues(crPara meterValues)

CrystalReportViewer1.ReportSource = report
Dec 10 '10 #1
5 10633
This thread is solved.
Dec 11 '10 #2
Dear awmantonio
can you show me how to solve it? I have same problem. Thank alot
Dec 21 '11 #3
Hi! I used this code which worked a lot better:

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.Shared

Private Sub Form1Rpt_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


Dim ProjectReport As New ReportDocument
ProjectReport.Load(Application.StartupPath & "\rptProjectRpt.rpt")

Dim report As rptProjectRpt = New rptProjectRpt
Dim crParameterDiscreteValue As ParameterDiscreteValue
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldLocation As ParameterFieldDefinition
Dim crParameterValues As ParameterValues
crParameterFieldDefinitions = report.DataDefinition.ParameterFields

crParameterFieldLocation = crParameterFieldDefinitions.Item("parText1")
crParameterValues = crParameterFieldLocation.CurrentValues
crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue
crParameterDiscreteValue.Value = Form1.Text1.Text
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldLocation.ApplyCurrentValues(crPara meterValues)

crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldLocation.ApplyCurrentValues(crPara meterValues)

crvProjectRpt.ReportSource = report


End Sub

Cheers!
Dec 21 '11 #4
You saved my life. It worked!


@awmantonio
Mar 10 '15 #5
Jincy7
1
though it's an old answer...this actually solved my problem...
"OLD IS GOLD" ... thank you




@awmantonio
Jul 26 '15 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Faraz Ahmed | last post: by
2 posts views Thread by Miguel | last post: by
2 posts views Thread by Malt via AccessMonster.com | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.