Display data from dataGrid to Crystal report vb.net

772 views Asked by At

I'm using mysql database to display data in dataGridview also i have a combobox as a filter, i want to display filtered data from datagridview to crystal report

1

There are 1 answers

0
Rahul kumar On

This is it: First you will work with ado.net tools will be easy for you add new Dataset from project Add New Item Then Add Your Colums To \The dataSet Created In your solution Directory

Then If You Hhave A datagridView Set The Datasource From The peoperies to the dataset you created\ now in the crystal report you will need to specify the datasource which will be your dataset

in the button_click which will generate your report write these code

dataSet11.AcceptChanges();

CrystalReport1 objRpt = new CrystalReport1();  


objRpt.SetDataSource(dataSet11.Tables[0]);

crystalReportViewer1.ReportSource = objRpt;