"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Wednesday, May 5, 2010

Crystal report in Asp.net C#

Hi everybody, Almost everybody had heard abt Crystal report.That is one of the powerfull tool in visual studio to export report to Pdf, Excel, Word,CSV,Txt. Whwn i google it i find Most result come on VB.when i post a requst on aspform one told me that it's simple in VB than C#. But i didn't feel like so I feel It's oppisite :) after creating it in C#.

Here is the documentation of that

Step 1:

Create a crystal report File in C#

Step 2:

Go to that file U will get a window like this On that select Blank Report


Step 3:
Drag 'n drop a crytal report viewer from the toolbox.It is used to view crystal report. 'n
our next step is to import database field to crystal report for that right click on database field and select database Expert

Step 4:
To connect a database we need a connection so goto New connection option OLE DB(ADO) Connection

Step 5:
Now u need to select OLE DB Provider. I'm using Sql so i select OLE DB Provider for sql server

Step 6:
Let's connect to Our database

Step 7
After Succefully doing that u will be forwarded to Advanced information Just click on finish

Step 8:
Goto to databse from Database Expert Window
Step 9:
Import that Table or View from where the data to be display.i'm taking a simple table


Step 10:
Now go to Database fields Where u can c all the field's of that table

Step 11:
Drag 'n drop the field  on Section 3(details),which u need to display

Step 12:
Click on MAin Report Preview to c all the data are displayed or not
Step 13:
From step 13 v are moving to coding section B'coz on this it will not run on server 'n also v can't give him the condition on which v need to diplay data This is a static display of our data.
for that i created a class file on that v can give our connection string 'n aspx.cs file i'm giving my Query 'n File name to do coding in crystal report v need to import some name space 'n documentaion of coding part is given in my sample project.

Thanks for pradeep for helping me on this project 'n i'm giving the sample source code here

Michael Jackson: This Is ItMichael Jackson: This Is It [Blu-ray]

No comments: