Skip to Content
Former Member
Aug 04, 2008 at 07:00 AM

No records shown in report ?


I have created a crystal report using dataset ("OleDB to SQL server database") and load it to a crystal report viewer in testreport2.aspx. No errors when run but no records where shown.

There is no problem with the data table return from GeneralProduct class as the DropDownList1 contains 30 item and textbox1 displays a total of 30 records from data table return.


Imports CrystalDecisions.CrystalReports.Engine

Partial Class testreport2

Inherits System.Web.UI.Page

Private oRpt As ReportDocument

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Not IsPostBack Then

CrystalReportViewer1.EnableDatabaseLogonPrompt = False

oRpt = New ReportDocument


Dim _GeneralProduct As New GeneralProduct


TextBox1.Text = "Record Count [" & CStr(_GeneralProduct.RecordsCount) & "]"


CrystalReportViewer1.ReportSource = oRpt



dd.DataTextField = "ProductID"

dd.DataValueField = "ProductID"

dd.DataSource = _GeneralProduct.oDataTable


_GeneralProduct = Nothing

End If

If IsPostBack Then

oRpt = Session.Item("oReport")

CrystalReportViewer1.ReportSource = oRpt

End If

End Sub

Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload

Session.Add("oReport", oRpt)

End Sub

End Class


Someone please assist....

Edited by: Kong Meng Chang on Aug 4, 2008 3:13 PM