How to create a simple report without writing a single line of code in VB.Net.
In this article I am going to show you how you can create reports in Microsoft visual Basic.Net using Microsoft Access 2007 without having to write any code for this tutorial.We will be using Microsoft Report Viewer for this Purpose.
How to create a simple report without writing a single line of code in VB.Net.
First create an Access Database and save it as employees and then create a table in this database and save it as emp.
Now, create the fields with the data types as shown below
Emp_id =autonumber
Empname=text
Designation=text
Sal=text
Open a new project in Visual Basic.Net
On the server explorer click add connection
Select data source as (Microsoft access database file (OLEDB)
Browse database and click on Test connection if succeeded click OK
Now, click on toolbox and select Microsoft Report viewer from the reporting section and drag it on the form.
Click on the arrow at the top of the ReportViewer1 and then click design a new report.
Select the table from the project data source click next and then select report type as tabular.
Click next and then select available fields to the details section.
Click next and then select stepped from the table layout and then click next and then select style as forest or any other you like.
Click next and then change the name of the report and then click finish.
Now a report will be added to your solution explorer.
Now go back to your form and click on the top arrow of the ReportViewer1 and then select the report from the choose report drop down menu. And run your project.
Enjoy.