Question: I want to generate a crystal report in visual studio 2010 in WPF application.

Can anyone please help me to solve out ?

I have tried but it does not works ..

please provide me the code ?

Answer: 
Crystal Report now doesn't comes with Visual Studio. You have to download it separately. Follow this link: <http://www.businessobjects.com/jump/xi/crvs2010/default.asp> .

Once you install the CR2010. You will be able to add crystal report pages (.rpt) in your project using VS 2010.
I don't think Crystal Reports are provided by default any more in VS2010, you have to download and install them separately.