|
Subject:
|
another parameter
|
|
Posted By:
|
drachx
|
Post Date:
|
10/3/2005 7:52:13 PM
|
i have created SP with a parameter. then i created a report bind to this SP with parameter parameter is @coname in SP
when i want to display it in crstal viewer, theres no data.
but when i create same stopred proced with no parameter bind it to crsyla repots as datasource. then in crystal i made my parameter which is "coname " then call this in my vb.net form inside crytal report then it shows. what the problem
tnx in advance
heres the code
Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared ' ' Load the selected report file. ' Dim CR As New ReportDocument CR.Load(strReportPath) ' ' Declare the parameter related objects. ' Dim crParameterDiscreteValue As ParameterDiscreteValue Dim crParameterFieldDefinitions As ParameterFieldDefinitions Dim crParameterFieldLocation As ParameterFieldDefinition Dim crParameterValues As ParameterValues ' ' Get the report's parameters collection. ' crParameterFieldDefinitions = CR.DataDefinition.ParameterFields ' ' Set the first parameter ' - Get the parameter, tell it to use the current values vs default value. ' - Tell it the parameter contains 1 discrete value vs multiple values. ' - Set the parameter's value. ' - Add it and apply it. ' - Repeat these statements for each parameter. ' crParameterFieldLocation = crParameterFieldDefinitions.Item("@coname") crParameterValues = crParameterFieldLocation.CurrentValues crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue crParameterDiscreteValue.Value = strStartDate crParameterValues.Add(crParameterDiscreteValue) crParameterFieldLocation.ApplyCurrentValues(crParameterValues) ' ' Set the Crytal Report Viewer control's source to the report document. ' CrystalReportViewer.ReportSource = CR
|
|