I do this program myself but i got a error in
"
an error occurred during local report processing the definition of the report 'report1' has not been specified Object reference not set to an instance of an object
I don't know how to solve this problem pls help me: My VB.net windows Application code is below:
Imports System.Data.OleDb
Imports Microsoft.Reporting.WinForms
Public Class Form1
Dim cn As New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=D:\Programs\sathish\invoicedb.mdb")
Dim cmd As OleDbCommand
Dim da As OleDbDataAdapter
Dim ds As DataSet
Dim sqlQRY As String = ""
Dim reportPath As String = "Custom Based RDLC Report Generation.Report1.rdlc"
Dim sReportDataSource As New ReportDataSource
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
cn.Open()
MsgBox("connected", MsgBoxStyle.Information)
sqlQRY = "Select invoiceid,Clientid,Clientname,Productname,Totalamount,BalanceAmount from receipt"
viewreports()
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
End Sub
Sub viewreports()
ds = New DataSet
da = New OleDbDataAdapter(sqlQRY, cn)
da.Fill(ds, "receipt")
ReportViewer1.LocalReport.ReportEmbeddedResource = reportPath
sReportDataSource.Name = "DataSet1"
sReportDataSource.Value = ds.Tables(0)
ReportViewer1.LocalReport.DataSources.Add(sReportDataSource)
Me.ReportViewer1.RefreshReport()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
sqlQRY = "Select invoiceid,Clientid,Clientname,Productname,Totalamount,BalanceAmount from receipt where Clientid=" & Val(TextBox1.Text)
viewreports()
End Sub
End Class
pls send your ideas..