Click here to Skip to main content
15,743,541 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can show subreport in crystalreportviewer without main report in
I tried opensubreport by reportdocument But I get an error 'not support reportviewer with subreport

What I have tried:

Private Sub OpenSubreport(ByVal reportObjectName As String)
         Dim subreportName As String
         Dim subreportObject As SubreportObject
         Dim subreport As New ReportDocument()

         If TypeOf (Report.ReportDefinition.ReportObjects. _
         Item(reportObjectName)) Is SubreportObject Then
            subreportObject = myReportDocument.ReportDefinition.ReportObjects. _
            subreportName = subreportObject.SubreportName
            subreport = myReportDocument.OpenSubreport(subreportName)
            MyCrystalReportViewer.ReportSource = subreport
         End If
      End Sub
Updated 31-Dec-19 0:40am
Maciej Los 31-Dec-19 6:40am    
reportviewer is not the same as crystalreport!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900