I am preparing a crystal report for library system... two tables..
1)BookIssueDetail:
fields : grno ,bookno,issuedat
2)studentMaster
fileds: grno,stdename,(and lots more)..only these filed are req to display...
now i have made a dataset : "bookissuedataset" which have two table which are assign above.
these is my code on print button
Dim str, str1 As String
Dim bookno As Integer
str1 = "Select bookno from bookmaster where bookname = '" + cmbName.Text + "'"
cmd = New OleDbCommand(str1, cn)
dr = cmd.ExecuteReader
If dr.HasRows Then
While dr.Read
bookno = dr(0).ToString
End While
End If
Dim l As New BookIssueDetail //this is my report name
str = "select BookIssueDetail.grno,StudentMaster.StudentName,BookIssueDetail.BookNo,BookIssueDetail.IssueDate from BookIssueDetail inner join studentmaster on studentmaster.grno=BookIssueDetail.grno where BookIssueDetail.bookno =" + bookno.ToString
da = New OleDbDataAdapter(str, cn)
Dim ds As New DataSet
da.Fill(ds, "BookIssueDetail,StudentMaster")
l.SetDataSource(ds)
Dim frm As New frmReportVeiwer(l) //this call a new form which have only reportviewer added in it.its code is dislpaly below
frm.Show()
Public Class frmReportVeiwer
Public Sub New(ByVal l As CrystalDecisions.CrystalReports.Engine.ReportDocument)
InitializeComponent()
CrystalReportViewer1.ReportSource = l
CrystalReportViewer1.Refresh()
End Sub
End Class
this is my code...this work fine when i have only one table in my dataset but when i have 2 or more table in my dataset then my crystal report cpe blank.no field is displayed.. ..all d report dislay all the field when i have only one table in my dataset..
please guide me in this matter.. i don't know i m missing a big ort small point here but this thing is killing me...my almost proj is done but i am stuck on this thing..