open crystal report and pass parameters from the row when datagridviewbutton column

Harris00

Member
Joined
Feb 27, 2009
Messages
9
Programming Experience
3-5
Hello

I have a datagridview with below column and i have button for each row and when button is clicked i would like to take the LogId, start date, end date and log date and pass it as parameters to crystal report and run the report using these parameters and display the report.

i have designed the report separately in crystal reports, can i use that or i need to design it in Visual Studio.

how do i pass parameters, run and display results of the report when button on datagridviewbutton column is clicked?

really appreciate your guidance.
 
A DataGridView is a control for displaying contents of its DataSource. Its important to note, that the undelying DataSource is what you actually want to work with and has nothing to do with the DGV. You can create your reports in Crystal or VS; although there may be a version difference between the two. You can pass parameters to the report but in this context it looks like the report isnt pulling anything from the database at all; you seem to be implying wanting to pull the full contents of what you want to display. The parameter(s) should be a value to tell the database which records you want to pull.

However another way of doing it where you dont have to pull from the database or pass it parameters is this. Create a Typed Dataset in your VB project. Fill your DataSet with the data you want to display in your DGV. Create your report pointing to your Typed Dataset (.xsd) file instead. The report never has to connect to the database or repull the data you already have in memory at the time. When you want to display the report, you pass it the dataset object you have filled to the report as the datasource (same as you do by connecting it to the DGV).
 
Back
Top