Click here to Skip to main content
15,921,990 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i want to send all data from datagridview to crystalreport for print.
I mean everything that currently show in datagridview1 will go to crystalReportViewer1 for print.
how to do that please?
Posted
Updated 21-Aug-12 11:40am
v2

1 solution

Instead of trying to extract the data from the datagridview, use the source of the data as a data source for Crystal.

For example if you're using a dataset, have a look at this article: Crystal Report with DataSet and DataTable using C#[^]
 
Share this answer
 
Comments
FM7 21-Aug-12 17:59pm    
every search command will result different data on datagridview.i want to print all data which are showing in datagridview just in time.(send to crystalReport)
ok?
Wendelius 21-Aug-12 18:04pm    
How do you do the filtering? If you filter the data from a dataset for example using a dataview, you can use the same dataview for Crystal. If you filter the data using SQL, the dataset already contains correct information.
FM7 21-Aug-12 18:16pm    
a combobox is filtering by 5 indexes.
a combobox and a button and a textbox are filtering by another way.
a button will select all records from my table.
so it is not clear what will show in datagridview right now.
Wendelius 21-Aug-12 18:24pm    
So this sounds like you're filling the datatable from the database (again if a datable is used). Of that is the case, after filtering your datatable contains the information shown in the datagridview hence it would be usable as a data source to Crystal.
FM7 21-Aug-12 18:27pm    
got it.thanks.you mean i can use current datatable for crystal.right?

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