Monday 6 October 2014

How to use Crystal Report in visual studio 2010

How to download and run crystal reports in C#

To work with crystal report please do following steps

ü  “Please make sure that your visual studio professional edition not enterprise edition or express edition”
ü  Visual studio lacks of it Download latest crystal report extension pack from the sap website.
ü  After the complete installation restart your computer of 10 to 20 minutes wait.
ü  Then Run visual studio
ü  Create new project add crystal report from reporting and on form where to show report you can drag and drop the crystal report from tool box if invisible tool then go to project property and change targeted frame work from .Net frame work4 client to “.Net frame4” build project.

ü  Beware Most Important Steps else you will fail to do coding of crystal report You received head ache error that folder dotnet or dotnet1 not found crdb_adoplus.dll in this location

“C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\crdb_adoplus.dll”

Go to this location till

“C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\”

Create new folder of “dotnet” which is required then copy the file from folder “C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86” and paste it in the “C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet

Now you got no error :D :D




ü  Modify app config file such that replace the startup with this code
<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    <requiredRuntime version="v4.0.20506" />
  </startup>

ü  Add headers of following in form1.cs code

   using CrystalDecisions.CrystalReports.Engine;
                   using CrystalDecisions.Shared;

ü Add reference as well
CrystalDecisions.Windows.Forms
ü Now your project is completely ready to execute :D :D
Now run your project crystal report perfectly works

Screen shot




Now you are done……!


Good Luck

No comments:

Post a Comment