Click here to Skip to main content
12,078,259 members (48,136 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET
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 21-Mar-13 23:32pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web04 | 2.8.160212.1 | Last Updated 23 Mar 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100