to 0. Try putting it on two lines:
also get zero. The "If crParamFieldDefinitions.Count > 1 Then ' with
Hope this helps.
"Kapil Shah via DotNetMonster.com" wrote:
> 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(ByVal reportname As String, ByRef patable As
> System.Web.UI.WebControls.Table) As Integer
>
> Doccr = New CrystalDecisions.CrystalReports.Engine.ReportDocum ent '
> instantiate a report document
>
> Doccr.Load(reportname) ' load the report whose name you were given
> Dim value As Integer = 0
>
> If Doccr.IsLoaded Then
>
>
> Dim crParamFieldDefinitions As
> CrystalDecisions.CrystalReports.Engine.ParameterFi eldDefinitions =
> Doccr.DataDefinition.ParameterFields
>
> If crParamFieldDefinitions.Count < 1 Then 'if no params,
> Return value = 1
> End if
>
> If crParamFieldDefinitions.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