Hello Everybody,
I am trying to write a crystal report function which should return a value
of 1 for crystal report with no parameter and return a value 2 for crystal
report with parameter.
Public Function LoadReport(ByVa l reportname As String, ByRef patable As
System.Web.UI.W ebControls.Tabl e) As Integer
Doccr = New CrystalDecision s.CrystalReport s.Engine.Report Docum ent '
instantiate a report document
Doccr.Load(repo rtname) ' load the report whose name you were given
Dim value As Integer = 0
If Doccr.IsLoaded Then
Dim crParamFieldDef initions As
CrystalDecision s.CrystalReport s.Engine.Parame terFi eldDefinitions =
Doccr.DataDefin ition.Parameter Fields
If crParamFieldDef initions.Count < 1 Then 'if no params,
Return value = 1
End if
If crParamFieldDef initions.Count > 1 Then ' with parameter
return value=2
End if
End if ' End of Doccr.IsLoaded
End Function
For some reason when I click the crystal report button with no parameter I
get the value as 0 (should return 1)and also when I click the crystal
report button with parameter I get the value as 0. (should return 2)
Would be greatful if someone helps with this function..
Rahil
--
Message posted via http://www.dotnetmonster.com