Click here to Skip to main content
15,614,270 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can anyone help create a rdlc report that will fetch data from access database using date as a parameter that is picked by the user on the interface
Updated 5-Jun-18 19:41pm

Well, here is a tip and great example.

1. Add a report form (report1.rdlc) to your project and design accordingly
2. Create a parameter from the ReportData tab (its on the left side of the screen close to the toolbox)
3. Add a reportViewer from the toolbox to your form that will display the report.
4. Dock it to make it cover the whole area of the form.
5. Add a datasource to your project (i.e. connect to database from vb)

go here[^] for the code.
Share this answer
Member 11647523 4-Dec-15 0:55am    
thanks............. But when I want to do RDLC report with MS Access DB file, then I cant see the data in Report window in run time....

My code is here below

Imports System.Data.OleDb
Imports Microsoft.Reporting.WinForms
Public Class Form1
Public CON As New OleDbConnection
Public ADP As New OleDbDataAdapter
Public CMD As New OleDbCommand
Public DS As New DataSet
Dim STR As String

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
CON.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=TESTDB.mdb"
CMD = New OleDbCommand(STR, CON)
ADP.SelectCommand = CMD
Dim CB As New OleDbCommandBuilder(ADP)
ADP.Fill(DS, "TB")
End Sub

Private Sub BTNREPORT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNREPORT.Click
ReportViewer1.LocalReport.ReportPath = ".....PATH.NAME...........\Report1.rdlc"
ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DS.TB", DS.Tables("TB")))
End Sub
End Class

N.B. Database name....TESTDB.mdb(not password protected) and table name = TB1
Create RDLC report using 2010 from SQL database

 Private Sub Formlogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim con As New SqlConnection
        con.ConnectionString = "connection Path"

        Dim cmd1 As New SqlClient.SqlCommand("select'columnname' from 'tablename'", con)

        Dim da As New SqlClient.SqlDataAdapter(cmd1)
        Dim ds As New DataSet()
        da.Fill(ds, "list")

        Dim col As New AutoCompleteStringCollection
        Dim i As Integer
        For i = 0 To ds.Tables(0).Rows.Count - 1
        TextBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
        TextBox1.AutoCompleteCustomSource = col
        TextBox1.AutoCompleteMode = AutoCompleteMode.Suggest
        Catch ex As Exception
      End Try
End Sub
Share this answer
CHill60 3-Apr-18 4:46am    
Apart from being 5 years too late, where is the RDLC report? And where is the date filter?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900