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?