TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


Forums >


NullReferenceException when binding to crystalReportViewer.ReportSource

NullReferenceException when binding to crystalReportViewer.ReportSource


8/16/2006 2:03:00 PM


Thank you for yuour help.

I am using VS.NET 2003 with Crystal XI r2. I am getting
NullReferenceException at the following line in my code.
oRptForm.crystalReportViewer.ReportSource = oReport

I did bind the oDataset with a datagrid to make sure it has data and it
does show 2 tables with data.

Please help me with this.

Private Sub btnShowReport_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnShowReport.Click

Dim oDataSet As New ProductivityDataSet()
Dim oReport As New Productivity()
Dim oProductivityReport As New
Dim oRptForm As ImmWinForms.ReportViewer

Status.ShowStatus("Generating Productivity Report...")
Me.Cursor = Cursors.WaitCursor

dtpStartDate.Value, dtpEndDate.Value)

If oDataSet.Productivity.Rows.Count > 0 Then
Status.ShowStatus("Loading Productivity Report...")
oReport.SummaryInfo.ReportTitle = "Productivity Report"
oReport.SummaryInfo.ReportComments = "Start Date: " &
dtpStartDate.Text & " End Date: " & dtpEndDate.Text
'Create the Report Form
oRptForm =

'Set the properties of the Report Form
oRptForm.Text = "Productivity Report"
oRptForm.crystalReportViewer.ShowCloseButton = False
oRptForm.crystalReportViewer.ShowGroupTreeButton =
oRptForm.crystalReportViewer.DisplayGroupTree = False
'oRptForm.crystalReportViewer.ReportSource = oReport
DataGrid1.DataSource = oDataSet

oRptForm.crystalReportViewer.ReportSource = oReport
Catch ex As NullReferenceException

End Try

'Me.Cursor = Cursors.Default
Me.Cursor = Cursors.Default
MessageBox.Show("There are no records to report on,
please adjust your query and try again", "Search Results",
MessageBoxButtons.OK, MessageBoxIcon.Information)
End If

End Sub
End Class

End Namespace

Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
NullReferenceException when binding to crystalReportViewer.ReportSource

Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te

Il servizio è completamente GRATUITO!