Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

crystal report, C# in .net

Status
Not open for further replies.

norav21

Technical User
Jul 10, 2003
1
US
Hi I am new at this, and I am looking for an example of a crystal report being used in a c# .net environment.

can anyone help
 
I've got an ASP.NET application that uses a half dozen crystal reports. It's in VB not C#, but you should be able to follow it since the basic premise requires little code.

The way I did it is...

Create a report(s) in the project. Then add a webform with the crystalreportviewer control. In the PageInit() event (might be called something else in c#) enter the following code to bind the report to the viewer:

CrystalReportViewer1.Reportsource = new CrystalReport1
CrystalReportViewer1.DataBind

You can also set the SelectionFormula on the viewer control.

That's it!

You can load/bind reports in other ways - see the Crystal documentation in Visual Studio - but I prefer this approach.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top