Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
private void button1_Click(object sender, EventArgs e)
        {
            this.gridTableAdapter1.Fill(this.grid1DataSet2.grid);
            this.reportViewer1.RefreshReport();
        }

/*The above code exports complete table to reportviewer but my need is that i will select a row from datagrid and that particular row alone should be exported to reportviewer in c#.*/
Posted
Updated 17-Sep-14 19:12pm
v2
Comments
hypermellow 17-Sep-14 6:09am    
Hi, can you post the code that you are using, details of what you have tried, and where you are stuck? Thanks.
Member 10239017 18-Sep-14 1:10am    
private void button1_Click(object sender, EventArgs e)
{
this.gridTableAdapter1.Fill(this.grid1DataSet2.grid);
this.reportViewer1.RefreshReport();
}

/*The above code exports complete table to reportviewer but my need is that i will select a row from datagrid and that particular row alone should be exported to reportviewer in c#.*/
BharatPrajapati212 17-Sep-14 6:44am    
post some your some code
Member 10239017 18-Sep-14 1:10am    
private void button1_Click(object sender, EventArgs e)
{
this.gridTableAdapter1.Fill(this.grid1DataSet2.grid);
this.reportViewer1.RefreshReport();
}

/*The above code exports complete table to reportviewer but my need is that i will select a row from datagrid and that particular row alone should be exported to reportviewer in c#.*/
Madhuri Gamane 17-Sep-14 8:53am    
if you are having id field on grid view, take one more one more column (i.e. status) in table and update that status from 0 to 1
when that row get select..
for that you have to select select single row at a time, so that you will get
its row index.

now when quering for report check report and select fields you want.

hope this will help..

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