Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SubReport in more than 1 records View

Status
Not open for further replies.

maecode

Programmer
Oct 22, 2003
6
SG
Can I control the sub report(s) if I got more than 1 records view?

eg.

ID = 123
Name = WW
subreport1
subreport2


-----------

ID = 124
Name = QQ
subreport1
subreport2

----------------
.
.
.


vb code behind:

Dim vNric As String
Dim objReport As New crProfile_IC()
Dim myDataSet As New DS_Profile() 'the xml Connection
Dim SqlName As String
Dim vTest As ReportDocument
Dim vTest1 As ReportDocument

vNric = ('123', '124')

If Left$(vNric, 1) = "'" And Right$(vNric, 1) = "'" Then
vNric = Right$(vNric, Len(vNric) - 1)
vNric = Left$(vNric, Len(vNric) - 1)
End If

SqlStmt = "SELECT * from IND_vPROFILE1 where nric_fin in ('" & vNric & "')"


Dim mySqlAdapter = New SqlDataAdapter(SqlStmt, sqlConn)
mySqlAdapter.Fill(myDataSet, "IND_vPROFILE1")
objReport.SetDataSource(myDataSet)
objReport.ReportOptions.EnableSaveDataWithReport = True
vTest = objReport.OpenSubreport("Suit_WOS")
vTest.RecordSelectionFormula = "{Ind_vProfile1.NRIC_FIN}='" & vNric & "'"
vTest1 = objReport.OpenSubreport("Case_B")
vTest1.RecordSelectionFormula = "{Ind_vProfile1.NRIC_FIN}='" & vNric & "'"
CrystalReportViewer1.ReportSource = objReport


How can I control the subreport to view multiple records?
the subreport will depend on the nric_fin
Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top