0
您好即时通讯使用3层架构..如何将SQL查询传递给Crystal Report?
Public Function SelectVoucher() As DataSet
Try
Squery = "select a.VoucherNo,convert(char(10),a.VoucherDate,120) as VoucherDate,
a.TotDebit,b.CustomerName as PartyName,c.Particulars
from spendmoney a,mcustomermaster b,spendmoneychild c
where a.partycode=b.customercode and a.voucherno=c.voucherno and
a.voucherno=3"
Return objdal.DBread(Squery)
Catch ex As Exception
Throw ex
End Try
End Function
这是我已被使用的查询,但晶体报告不显示此查询..
它显示的所有字段..
但原始查询答案是这样的:
3 2011-08-28 1500 prakash www
这是我已经使用的编码。
sub crystalreport
Dim ds As New DataSet
Dim objrpt As New CrystalReport10
ds = bol.SelectVoucher()
If ds.Tables(0).Rows.Count > 0 Then
objrpt.SetDataSource(bol.SelectVoucher())
CrystalReportViewer1.ReportSource = objrpt
objrpt.Refresh()
CrystalReportViewer1.RefreshReport()
End If
end sub
如何将查询传递给Crystal Reports?