|
-
Oct 17th, 2006, 07:49 AM
#6
New Member
Re: Crystal report help
Here is some code that might help. You have to have the CrystalReportViewer on your form. This goes in the code of the class. When you drag the subreport onto the report you'll have to fill in the object name within the format tab of the subreport. I recommend you do your report and subreport work within the VS environment.
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 is for the subreport on the main report, format object option
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
|