Crystal Runtime .Net - parameters not recognized on Windows Server 2019
source link: https://answers.sap.com/questions/13951740/crystal-runtime-net-parameters-not-recognized-on-w.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Crystal Runtime .Net - parameters not recognized on Windows Server 2019
I am a developer with a Crystal Reports runtime issue. I am moving an existing ASP.Net script from Windows Server 2012 to Windows Server 2019. Everything works except passing parameters. Reports without parameters display properly in viewer. Reports with parameters do not. The parameters passed in the URL string are being read by the script and passed to the reports engine, but not being used by the engine. Am getting "missing parameter values" error (or continually being prompted to satisfy paramaters (depending on EnableParameterPrompt= setting). I have tried SP25 through SP33 of CR32bit runtime for .Net. All have same problem on Windows Server 2019. Has worked fine (for years) on Windows Server 2012.
Code snippet - from vb script (asp.net)
crReportDocument.Load(sDocLocation)
'init Params in Viewer
CrystalReportViewer1.ParameterFieldInfo.Clear()
'new variables
Dim ParamFields As New CrystalDecisions.Shared.ParameterFields
Dim ParamField As New CrystalDecisions.Shared.ParameterField
Dim DiscreteVal As New CrystalDecisions.Shared.ParameterDiscreteValue()
'Begin Parameter Section Loop
For Each param As ParameterField In crReportDocument.ParameterFields
ParamField.ParameterFieldName = param.Name
DiscreteVal.Value = Request(param.Name)
If Not String.IsNullOrEmpty(DiscreteVal.Value) Then
'Response.Write(param.Name)
ParamField.CurrentValues.Add(DiscreteVal)
' Add the parameter to the parameter fields collection.
'...response.write() included here correctly lists each parameter name and passed in value
ParamFields.Add(ParamField)
End If
DiscreteVal = New CrystalDecisions.Shared.ParameterDiscreteValue()
ParamField = New CrystalDecisions.Shared.ParameterField()
'End Parameter Section
'pass ParamFields collection back to the Viewer
CrystalReportViewer1.ParameterFieldInfo = ParamFields
I have tried moving the above code/section before the DB login/connection section, as well as after that section. No difference.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK