469,955 Members | 1,441 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,955 developers. It's quick & easy.

data is nt seen in Cyrstal report in VB.net when there are twio or more table in DS..

I am preparing a crystal report for library system...
two tables..


fields : grno ,bookno,issuedat


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,Boo kIssueDetail.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")

Dim frm As New frmReportVeiwer(l) //this call a new form which have only reportviewer added in it.its code is dislpaly below

Public Class frmReportVeiwer

Public Sub New(ByVal l As CrystalDecisions.CrystalReports.Engine.ReportDocum ent)
CrystalReportViewer1.ReportSource = l
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..
May 5 '09 #1
1 1458
142 100+
Try to set the specific table to the report instead of setting dataset as the datasource.

May 6 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Ümit Kavala | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.