Click here to Skip to main content
16,018,938 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
Posted
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 http://www.sourcecodester.com/visual-basic-net/load-rdlc-report-using-report-viewer-programmatically.html[^] for the code.
 
Share this answer
 
Comments
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"
CON.Open()
STR = "SELECT * FROM TB1"
CMD = New OleDbCommand(STR, CON)
ADP.SelectCommand = CMD
Dim CB As New OleDbCommandBuilder(ADP)
ADP.Fill(DS, "TB")
Me.ReportViewer1.RefreshReport()
Me.ReportViewer1.RefreshReport()
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.Clear()
ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DS.TB", DS.Tables("TB")))
ReportViewer1.RefreshReport()
End Sub
End Class

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

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

        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
        col.Add(ds.Tables(0).Rows(i)("columnname").ToString)
        Next
        TextBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
        TextBox1.AutoCompleteCustomSource = col
        TextBox1.AutoCompleteMode = AutoCompleteMode.Suggest
        con.Close()
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
      End Try
End Sub
 
Share this answer
 
Comments
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