on 09-02-2008 6:15 PM
Here is a simplified example of what I am trying to do... I simply want to be able to set a parameter in a
sub report (the sub report was dynamically added using RAS) to some value... this example does not work.
Can anyone correct the syntax in this example so it works:
Dim objParameterFieldDefinitions As CrystalDecisions.ReportAppServer.DataDefModel.Fields
Dim objParameterFieldDefinition As CrystalDecisions.ReportAppServer.DataDefModel.ParameterField
Dim objNewParameterFieldDefinition As CrystalDecisions.ReportAppServer.DataDefModel.ParameterField
objParameterFieldDefinitions = boSubreportClientDocument.DataDefController.DataDefinition.ParameterFields
Dim strValue as string = "Hello"
For Each objParameterFieldDefinition In objParameterFieldDefinitions
If objParameterFieldDefinition.Name = "Test" Then
objNewParameterFieldDefinition = objParameterFieldDefinition.Clone(True)
Dim objParameterDescreteValue As New _
CrystalDecisions.ReportAppServer.DataDefModel.ParameterFieldDiscreteValue
objParameterDescreteValue = objParameterFieldDefinition.Values
objParameterDescreteValue.Value = strValue 'THIS IS NOT VALID... NOT SURE HOW TO SET THE VALUE
objParameterValues = objNewParameterFieldDefinition.Values
objParameterValues.Add(objParameterDescreteValue)
boSubreportClientDocument.DataDefController.ParameterFieldController.Modify( _
objParameterFieldDefinition, objNewParameterFieldDefinition)
End If
Next
Thanks,
Jeff
I would suggest to set the parameter from the main report like this:
boMainreportClientDocument.DataDefController.ParameterFieldController.SetCurrentValue(boSubreportClientDocument.Name, strName, strValue)
Typically the way the parameters used to work with the other .NET SDK was that all parameters in the report including the subreport were concidered to be owned by the main report and set through the main report object. In my scenerio the above worked.
Trevor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.