Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
How can I pass data from datagridview to Crystal Report in C# I created a crystal report with the same grid-view columns I want to pass all the data from grid-view to crystal report by a button click please help
Posted
Updated 3-Nov-14 22:38pm

 
Share this answer
 
Comments
Attiq Ur Rehman 9-Nov-14 13:55pm    
Sir I tried it but actually I am working with database in my application and I want that when ever I click on a button "Generate Report" all the data in my gird view should be automatically transferred to crystal report.
Hi Attiq,

You can do it through query string like if you are redirecting to Report.aspx. You can add
this code in your gridview column for which you want the crystal report

C#
<asp:hyperlink id="HyperLink1" runat="server" font-underline="true" navigateurl="<%# Eval("Assigned_To", "~/Report.aspx?column1={0}")</pre></xml>" xmlns:asp="#unknown"></asp:hyperlink>
 
Share this answer
 
Comments
Attiq Ur Rehman 9-Nov-14 13:56pm    
I am thankful to you but I am working with desktop application window form application
not with the asp so please If you can share some window application from material.
then it is more easy


make a class file in ur project and declare variable which you want to show and on double click on grid view on double click insert the value in the variable that are made in class file and show the form as Form.ShowDialoge() and insert the values on page load of the form
 
Share this answer
 

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