|
-
Jun 6th, 2006, 03:43 PM
#5
New Member
Re: Attaching Report to Crystal Report Viewer Control
Here is code that we struggled with to make subreports work with CR11 in a VS2005 vb.net environment. The CR white papers helped but were not very clear. We put the CrystalReportViewer on the invoke form with all the SQL adapters and data sets and just turn it visible/not visible. We did not put a Report Document object on the CrystalReportViewer. Hope it helps.
Dim subreportname1 As String
Dim subreportobject1 As SubreportObject
Dim subreport1 As New ReportDocument
DataSetRptDocketBase1.Clear()
SqlRptDocketBase.Fill(DataSetRptDocketBase1)
DataSetRptSubDocketDetail1.Clear()
SqlRptSubDocketDetail.Fill(DataSetRptSubDocketDetail1)
Dim myreport As RptDocketsShort = New RptDocketsShort
subreportobject1 = myreport.ReportDefinition.ReportObjects.Item("ObjRptSubDocketDetail")
‘ This object name identifies the subreport object on the main report
' and must be entered in the main report designer
subreportname1 = subreportobject1.SubreportName
subreport1 = myreport.OpenSubreport(subreportname1)
subreport1.SetDataSource(DataSetRptSubDocketDetail1)
myreport.SetDataSource(DataSetRptDocketBase1)
CrystalReportViewer1.ReportSource = myreport
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|