Quantcast
Channel: SCN : Unanswered Discussions - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 2556

Retrieving the subreport record count

$
0
0

Hi,

 

We are using the SAP Crystal runtime for Visual Studio, SP 14 and we are attempting to retrieve the count of records in a subreport, but are unable to do so because the Rows.Count always returns a value greater than 0 even when no data are returned by the subreport.

 

Sample code:

 

Private Function SubreportHasData(ByVal reportDocument As Object) As Boolean

 

Dim sections As Object = reportDocument.ReportDefinition.Sections

For Each section As Object In sections

    Dim reportObjects As Object = section.ReportObjects

 

    For Each subReportObject As Object In reportObjects

If subReportObject.Kind = 5 Then

Dim subReport As Object = subReportObject.OpenSubreport(subReportObject.SubreportName)

If subReport.Rows.Count > 0 Then Return True

End If

    Next

Next

 

Return False

End Function


When checking many of the subreport object properties in the IDE, we noticed most of the message values either contained an exception message or that they are not supported in subreports.


Is there a more appropriate property to use?


Thanks.


Viewing all articles
Browse latest Browse all 2556

Trending Articles