I am preparing a crystal report for library system...
two tables..
1)BookIssueDeta il:
fields : grno ,bookno,issueda t
2)studentMaster
fileds: grno,stdename,( and lots more)..only these filed are req to display...
now i have made a dataset : "bookissuedatas et" 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(st r1, cn)
dr = cmd.ExecuteRead er
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,StudentMa ster.StudentNam e,BookIssueDeta il.BookNo,BookI ssueDetail.Issu eDate from BookIssueDetail inner join studentmaster on studentmaster.g rno=BookIssueDe tail.grno where BookIssueDetail .bookno =" + bookno.ToString
da = New OleDbDataAdapte r(str, cn)
Dim ds As New DataSet
da.Fill(ds, "BookIssueDetai l,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 CrystalDecision s.CrystalReport s.Engine.Report Document)
InitializeCompo nent()
CrystalReportVi ewer1.ReportSou rce = l
CrystalReportVi ewer1.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 dataaset..
pleae guide me in this matter..
i dont 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..
two tables..
1)BookIssueDeta il:
fields : grno ,bookno,issueda t
2)studentMaster
fileds: grno,stdename,( and lots more)..only these filed are req to display...
now i have made a dataset : "bookissuedatas et" 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(st r1, cn)
dr = cmd.ExecuteRead er
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,StudentMa ster.StudentNam e,BookIssueDeta il.BookNo,BookI ssueDetail.Issu eDate from BookIssueDetail inner join studentmaster on studentmaster.g rno=BookIssueDe tail.grno where BookIssueDetail .bookno =" + bookno.ToString
da = New OleDbDataAdapte r(str, cn)
Dim ds As New DataSet
da.Fill(ds, "BookIssueDetai l,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 CrystalDecision s.CrystalReport s.Engine.Report Document)
InitializeCompo nent()
CrystalReportVi ewer1.ReportSou rce = l
CrystalReportVi ewer1.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 dataaset..
pleae guide me in this matter..
i dont 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..
Comment