First of all, this is not a very advanced compilation.ArticleIt indicates learning.
What is Crystal Reports?
Crystal Reports has been part of Visual Studio since 1993 and has now become a standard report creation tool in Visual Studio 2005. This tool is attached to each Visual Studio 2005 and is directly integrated into the development environment.
Use Crystal Reports for Visual Studio 2005 to create interactive content that meets the demo quality in a Windows environment. Use Crystal Reports for Visual Studio 2005ProgramCreate complex and professional reports. Then, you can connect a report to almost all data sources and proxy data, such as a result set (for example, An ADO. Net dataset ). The wizard that comes with the GUI designer allows you to easily set formatting, grouping, chart creation, and other conditions.
By using one of the Crystal Reports for Visual Studio 2005 viewer controls, you can host reports in web or Windows applications. Reports displayed on Windows clients and HTML 3.2 or 4.0 clients are highly interactive and provide functions such as deepening charts, report navigation, and text search.(From msdn)
Well, I can't say anything nonsense. Let's look at the example below (vs2008)
1. winform CRYSTAL REPORT
A. Create a project ()
B. Add a dataset file dataset1.xsd to this project.
C. Add a report file crystalreport1.rpt
D. Add a crystalreportviewer1 control to the form.
E. Write as bindingCode
Dataset DS= NewDataset ();
Using (Sqlconnection con = New Sqlconnection ( " Server =.; database = usersinfro; uid = sa; Pwd = sa123; " ))
{
Sqlcommand cmd = New Sqlcommand ( " Select * From usermsg " , Con );
Sqldataadapter da = New Sqldataadapter ();
Da. selectcommand = CMD;
Con. open ();
Da. Fill (DS );
}
Crystalreport1 cr = New Crystalreport1 ();
Cr. setdatasource (Ds. Tables [ 0 ]);
Crystalreportviewer1.reportsource = CR;
F. Check the running results.
Here is a simple example to get started
Note that there is a difference between the Web crystal report and winform. The former needs to be sent back when the next page is clicked.