Print Page | Close Window

Crystal Report not display by pass in parameter

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17010
Printed Date: 21 May 2024 at 11:18pm


Topic: Crystal Report not display by pass in parameter
Posted By: youngboyguy
Subject: Crystal Report not display by pass in parameter
Date Posted: 11 Jul 2012 at 11:25pm
Hi,
 
Good day. I have a crystal report design that consist of 1 parameter. I am written a code that try to pass in the value to Crystal Report so that it will display the report according to what i want.
 
However, it does not seems to be display the records that i want, but it just ignore my parameter and show all the records.
 
Here is my code:
 
__________________________________________________________

    Private Sub frmPreview_Load(sender As Object, e As System.EventArgs) Handles Me.Load

        Dim cryRpt As New ReportDocument

 

        cryRpt.Load(“C:\\Dynamics\Reports\Report1.rpt”)

 

            Try

 

                Dim crParameterFieldDefinitions As ParameterFieldDefinitions

                Dim crParameterFieldDefinition As ParameterFieldDefinition

                Dim crParameterValues As New ParameterValues

                Dim crParameterDiscreteValue As New ParameterDiscreteValue

 

                crParameterDiscreteValue.Value = "15"

                crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields

                crParameterFieldDefinition = crParameterFieldDefinitions.Item("ACTINDX")

                crParameterValues = crParameterFieldDefinition.CurrentValues

 

                crParameterValues.Clear()

                crParameterValues.Add(crParameterDiscreteValue)

                crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

 

                cryRpt.ParameterFields(0).CurrentValues = crParameterValues

 

                CrystalReportViewer1.ReportSource = cryRpt

                CrystalReportViewer1.Refresh()

 

       End Sub

________________________________________________________________

Can anyone please help? Thanks.




Replies:
Posted By: kevlray
Date Posted: 12 Jul 2012 at 5:34am
Is there a selection criteria in the report (check the select expert)?


Posted By: youngboyguy
Date Posted: 12 Jul 2012 at 3:31pm
IN the report, select expert, i have following code:
{GL00100.ACTINDX}={?ACTINDX}
 
Please help. :)



Print Page | Close Window